// File: /workspace/github_cpp_makefile_star2_O1/Alcaro[P]bridges/game.cpp
// Function: (anonymous namespace)::game_impl::game_load(int, bool)
void game_load(int id, bool use_kb)
	{
		map_id = id;
		if (id < 30)
		{
			map.init(game_maps[id]);
			tileset = id/10;
		}
		else
		{
			gamemap::genparams p = game_params(id);
#ifdef ARLIB_THREAD
			if (gamegen_next[id-100])
			{
				gamemap::generator::unpack(p, gamegen_next[id-100], map);
				gamegen_next[id-100] = 0;
			}
			else // this can only happen if player enters a map, leaves, and reenters, within half a second (or savefile is corrupt)
			     // getting a generator delay is suboptimal, but unavoidable, and no human can click that fast
#endif
				map.generate(p);
			map.reset();
			
			tileset = id-100;
		}
		
		popup_id = pop_none;
		popup_frame = 0;
		if (id == 0) popup_id = pop_tutor1;
		if (id == 5) popup_id = pop_lv6p1;
		if (id == 10) popup_id = pop_lv11;
		if (id >= 100 && !seen_random_tutorial)
		{
			seen_random_tutorial = true;
			popup_id = pop_tutorrandom1;
		}
		
		birdfg.reset(false);
		
		game_kb_state = use_kb ? 1 : 0;
		game_kb_x = 0;
		game_kb_y = 0;
		
		recent_change = true;
	}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movl %edx, %ebp
movl %esi, %r14d
movq %rdi, %rbx
movl %esi, 0x24a70(%rdi)
cmpl $0x1d, %esi
jg 0x22a7c
leaq 0x68(%rbx), %rdi
movslq %r14d, %r15
leaq 0x22e69(%rip), %rax     # 0x458c0
movq (%rax,%r15,8), %rsi
callq 0x22e1c
imulq $0x66666667, %r15, %rax # imm = 0x66666667
movq %rax, %rcx
shrq $0x3f, %rcx
sarq $0x22, %rax
addl %ecx, %eax
movl %eax, 0x48(%rbx)
jmp 0x22b5d
xorl %eax, %eax
movq %rax, 0x18(%rsp)
movq %rax, 0xc(%rsp)
movb $0x0, 0x14(%rsp)
leaq 0x32c(%rip), %rcx       # 0x22dc0
movq %rcx, 0x28(%rsp)
movq %rcx, 0x20(%rsp)
movq %rax, 0x30(%rsp)
movw $0x7, 0x8(%rsp)
movb $0x7, 0x9(%rsp)
movl $0x3ecccccd, 0xc(%rsp)  # imm = 0x3ECCCCCD
movl $0x4e20, 0x1c(%rsp)     # imm = 0x4E20
movw $0x101, 0x11(%rsp)      # imm = 0x101
cmpl $0x66, %r14d
je 0x22af4
cmpl $0x65, %r14d
je 0x22aea
cmpl $0x64, %r14d
jne 0x22b03
movl $0x3e4ccccd, 0xc(%rsp)  # imm = 0x3E4CCCCD
movl $0x3f400000, 0x18(%rsp) # imm = 0x3F400000
jmp 0x22b03
movl $0x3f800000, 0x18(%rsp) # imm = 0x3F800000
jmp 0x22b03
movl $0x3f800000, 0x18(%rsp) # imm = 0x3F800000
movw $0x909, 0x8(%rsp)       # imm = 0x909
leal -0x64(%r14), %r13d
movslq %r14d, %r15
movq 0x24760(%rbx,%r15,8), %rsi
leaq 0x68(%rbx), %r12
testq %rsi, %rsi
je 0x22b3a
addq $-0x64, %r15
leaq 0x8(%rsp), %rdi
movq %r12, %rdx
callq 0x25474
movq $0x0, 0x24a80(%rbx,%r15,8)
jmp 0x22b47
leaq 0x8(%rsp), %rsi
movq %r12, %rdi
callq 0x22de0
movq %r12, %rdi
callq 0x233e0
movl %r13d, 0x48(%rbx)
leaq 0x20(%rsp), %rdi
callq 0x22dc4
movq $0x0, 0x24ac4(%rbx)
testl %r14d, %r14d
je 0x22b87
cmpl $0xa, %r14d
je 0x22b80
cmpl $0x5, %r14d
jne 0x22b92
movl $0x7, %eax
jmp 0x22b8c
movl $0x9, %eax
jmp 0x22b8c
movl $0x3, %eax
movl %eax, 0x24ac4(%rbx)
cmpl $0x64, %r14d
jl 0x22bb2
cmpb $0x0, 0x24acd(%rbx)
jne 0x22bb2
movb $0x1, 0x24acd(%rbx)
movl $0xd, 0x24ac4(%rbx)
leaq 0x50(%rbx), %rdi
xorl %esi, %esi
callq 0x223ec
movb %bpl, 0x24ac1(%rbx)
movq $0x0, 0x24ab8(%rbx)
movb $0x1, 0x21(%rbx)
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq