// File: /workspace/github_cpp_makefile_star2_O3/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 0x2271c
leaq 0x68(%rbx), %rdi
movslq %r14d, %r15
leaq 0x231c9(%rip), %rax     # 0x458c0
movq (%rax,%r15,8), %rsi
callq 0x22abc
imulq $0x66666667, %r15, %rax # imm = 0x66666667
movq %rax, %rcx
shrq $0x3f, %rcx
sarq $0x22, %rax
addl %ecx, %eax
movl %eax, 0x48(%rbx)
jmp 0x227f8
movabsq $0x4e2000000000, %rax   # imm = 0x4E2000000000
movq %rax, 0x18(%rsp)
movb $0x0, 0x14(%rsp)
leaq 0x327(%rip), %rax       # 0x22a5e
movq %rax, 0x28(%rsp)
movq %rax, 0x20(%rsp)
movq $0x0, 0x30(%rsp)
movw $0x707, 0x8(%rsp)       # imm = 0x707
movq $0x3ecccccd, 0xc(%rsp)  # imm = 0x3ECCCCCD
movw $0x101, 0x11(%rsp)      # imm = 0x101
cmpl $0x66, %r14d
je 0x2278f
cmpl $0x65, %r14d
je 0x22785
cmpl $0x64, %r14d
jne 0x2279e
movl $0x3e4ccccd, 0xc(%rsp)  # imm = 0x3E4CCCCD
movl $0x3f400000, 0x18(%rsp) # imm = 0x3F400000
jmp 0x2279e
movl $0x3f800000, 0x18(%rsp) # imm = 0x3F800000
jmp 0x2279e
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 0x227d5
addq $-0x64, %r15
leaq 0x8(%rsp), %rdi
movq %r12, %rdx
callq 0x254ba
movq $0x0, 0x24a80(%rbx,%r15,8)
jmp 0x227e2
leaq 0x8(%rsp), %rsi
movq %r12, %rdi
callq 0x22a7e
movq %r12, %rdi
callq 0x230d2
movl %r13d, 0x48(%rbx)
leaq 0x20(%rsp), %rdi
callq 0x22a62
movq $0x0, 0x24ac4(%rbx)
testl %r14d, %r14d
je 0x22822
cmpl $0xa, %r14d
je 0x2281b
cmpl $0x5, %r14d
jne 0x2285d
movl $0x7, %eax
jmp 0x22827
movl $0x9, %eax
jmp 0x22827
movl $0x3, %eax
movl %eax, 0x24ac4(%rbx)
leaq 0x50(%rbx), %rdi
xorl %esi, %esi
callq 0x2204a
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
cmpl $0x64, %r14d
jl 0x2282d
cmpb $0x0, 0x24acd(%rbx)
jne 0x2282d
movb $0x1, 0x24acd(%rbx)
movl $0xd, %eax
jmp 0x22827