// File: JMMackenzie[P]binary_to_jass/compress_integer_elias_gamma_simd.cpp
// Function: unsigned int JASS::maths::ceiling_log2<unsigned int>(unsigned int)
static constexpr TYPE ceiling_log2(TYPE x)
			{
			/* coverity[BAD_SHIFT] */
			/* coverity[CONSTANT_EXPRESSION_RESULT] */
			return (static_cast<size_t>(x) >> 8 == 0) ?
				maths_ceiling_log2_answer[x] :
			(static_cast<size_t>(x) >> 16 == 0) ?
				maths_ceiling_log2_answer[(static_cast<size_t>(x) >> 8) & 0xFF] + 8 :
			(static_cast<size_t>(x) >> 24 == 0) ?
				maths_ceiling_log2_answer[(static_cast<size_t>(x) >> 16) & 0xFF] + 16 :
			(static_cast<size_t>(x) >> 32 == 0) ?
				maths_ceiling_log2_answer[(static_cast<size_t>(x) >> 24) & 0xFF] + 24 :
			(static_cast<size_t>(x) >> 40 == 0) ?
				maths_ceiling_log2_answer[(static_cast<size_t>(x) >> 32) & 0xFF] + 32 :
			(static_cast<size_t>(x) >> 48 == 0) ?
				maths_ceiling_log2_answer[(static_cast<size_t>(x) >> 40) & 0xFF] + 40 :
			(static_cast<size_t>(x) >> 56 == 0) ?
				maths_ceiling_log2_answer[(static_cast<size_t>(x) >> 48) & 0xFF] + 48 :
				maths_ceiling_log2_answer[(static_cast<size_t>(x) >> 56) & 0xFF] + 56;
			}

// Assembly:
movl %edi, -0x4(%rsp)
movl -0x4(%rsp), %eax
shrq $0x8, %rax
cmpq $0x0, %rax
jne 0x3005ac
movl -0x4(%rsp), %eax
movl %eax, %ecx
leaq 0x3e91(%rip), %rax      # 0x304430
movzbl (%rax,%rcx), %eax
movl %eax, -0x8(%rsp)
jmp 0x30073d
movl -0x4(%rsp), %eax
shrq $0x10, %rax
cmpq $0x0, %rax
jne 0x3005e2
movl -0x4(%rsp), %eax
movl %eax, %ecx
shrq $0x8, %rcx
andq $0xff, %rcx
leaq 0x3e5e(%rip), %rax      # 0x304430
movzbl (%rax,%rcx), %eax
addl $0x8, %eax
movl %eax, -0xc(%rsp)
jmp 0x300735
movl -0x4(%rsp), %eax
shrq $0x18, %rax
cmpq $0x0, %rax
jne 0x300618
movl -0x4(%rsp), %eax
movl %eax, %ecx
shrq $0x10, %rcx
andq $0xff, %rcx
leaq 0x3e28(%rip), %rax      # 0x304430
movzbl (%rax,%rcx), %eax
addl $0x10, %eax
movl %eax, -0x10(%rsp)
jmp 0x30072d
movl -0x4(%rsp), %eax
shrq $0x20, %rax
cmpq $0x0, %rax
jne 0x30064e
movl -0x4(%rsp), %eax
movl %eax, %ecx
shrq $0x18, %rcx
andq $0xff, %rcx
leaq 0x3df2(%rip), %rax      # 0x304430
movzbl (%rax,%rcx), %eax
addl $0x18, %eax
movl %eax, -0x14(%rsp)
jmp 0x300725
movl -0x4(%rsp), %eax
shrq $0x28, %rax
cmpq $0x0, %rax
jne 0x300684
movl -0x4(%rsp), %eax
movl %eax, %ecx
shrq $0x20, %rcx
andq $0xff, %rcx
leaq 0x3dbc(%rip), %rax      # 0x304430
movzbl (%rax,%rcx), %eax
addl $0x20, %eax
movl %eax, -0x18(%rsp)
jmp 0x30071d
movl -0x4(%rsp), %eax
shrq $0x30, %rax
cmpq $0x0, %rax
jne 0x3006b7
movl -0x4(%rsp), %eax
movl %eax, %ecx
shrq $0x28, %rcx
andq $0xff, %rcx
leaq 0x3d86(%rip), %rax      # 0x304430
movzbl (%rax,%rcx), %eax
addl $0x28, %eax
movl %eax, -0x1c(%rsp)
jmp 0x300715
movl -0x4(%rsp), %eax
shrq $0x38, %rax
cmpq $0x0, %rax
jne 0x3006ea
movl -0x4(%rsp), %eax
movl %eax, %ecx
shrq $0x30, %rcx
andq $0xff, %rcx
leaq 0x3d53(%rip), %rax      # 0x304430
movzbl (%rax,%rcx), %eax
addl $0x30, %eax
movl %eax, -0x20(%rsp)
jmp 0x30070d
movl -0x4(%rsp), %eax
movl %eax, %ecx
shrq $0x38, %rcx
andq $0xff, %rcx
leaq 0x3d2e(%rip), %rax      # 0x304430
movzbl (%rax,%rcx), %eax
addl $0x38, %eax
movl %eax, -0x20(%rsp)
movl -0x20(%rsp), %eax
movl %eax, -0x1c(%rsp)
movl -0x1c(%rsp), %eax
movl %eax, -0x18(%rsp)
movl -0x18(%rsp), %eax
movl %eax, -0x14(%rsp)
movl -0x14(%rsp), %eax
movl %eax, -0x10(%rsp)
movl -0x10(%rsp), %eax
movl %eax, -0xc(%rsp)
movl -0xc(%rsp), %eax
movl %eax, -0x8(%rsp)
movl -0x8(%rsp), %eax
retq
nopw %cs:(%rax,%rax)