	.file	"40587.c"
	.intel_syntax noprefix
	.text
	.section	.rodata
.LC0:
	.string	"Bit %d is invalid\n"
	.text
	.globl	getNthBit
	.type	getNthBit, @function
getNthBit:
.LFB6:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 16
	mov	DWORD PTR -4[rbp], edi
	mov	DWORD PTR -8[rbp], esi
	cmp	DWORD PTR -8[rbp], 0
	js	.L2
	cmp	DWORD PTR -8[rbp], 31
	jle	.L3
.L2:
	mov	eax, DWORD PTR -8[rbp]
	mov	esi, eax
	lea	rdi, .LC0[rip]
	mov	eax, 0
	call	printf@PLT
	mov	edi, 1
	call	exit@PLT
.L3:
	mov	eax, DWORD PTR -8[rbp]
	mov	edx, 1
	mov	ecx, eax
	sal	edx, cl
	mov	eax, edx
	and	eax, DWORD PTR -4[rbp]
	test	eax, eax
	setne	al
	movzx	eax, al
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	getNthBit, .-getNthBit
	.section	.rodata
	.align 8
.LC1:
	.string	"Invalid call to numToBits! nBits is %d, nNums is %d\n"
	.text
	.globl	numToBits
	.type	numToBits, @function
numToBits:
.LFB7:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	push	rbx
	sub	rsp, 56
	.cfi_offset 3, -24
	mov	QWORD PTR -40[rbp], rdi
	mov	DWORD PTR -44[rbp], esi
	mov	QWORD PTR -56[rbp], rdx
	mov	DWORD PTR -48[rbp], ecx
	mov	eax, DWORD PTR -44[rbp]
	sal	eax, 5
	cmp	DWORD PTR -48[rbp], eax
	jge	.L6
	mov	edx, DWORD PTR -44[rbp]
	mov	eax, DWORD PTR -48[rbp]
	mov	esi, eax
	lea	rdi, .LC1[rip]
	mov	eax, 0
	call	printf@PLT
	jmp	.L5
.L6:
	mov	DWORD PTR -24[rbp], 0
	jmp	.L8
.L11:
	mov	DWORD PTR -20[rbp], 0
	jmp	.L9
.L10:
	mov	eax, 31
	sub	eax, DWORD PTR -20[rbp]
	mov	edx, eax
	mov	eax, DWORD PTR -24[rbp]
	lea	rcx, 0[0+rax*4]
	mov	rax, QWORD PTR -40[rbp]
	add	rax, rcx
	mov	eax, DWORD PTR [rax]
	mov	ecx, DWORD PTR -24[rbp]
	mov	esi, ecx
	sal	esi, 5
	mov	ecx, DWORD PTR -20[rbp]
	add	ecx, esi
	mov	ecx, ecx
	lea	rsi, 0[0+rcx*4]
	mov	rcx, QWORD PTR -56[rbp]
	lea	rbx, [rsi+rcx]
	mov	esi, edx
	mov	edi, eax
	call	getNthBit
	mov	DWORD PTR [rbx], eax
	add	DWORD PTR -20[rbp], 1
.L9:
	cmp	DWORD PTR -20[rbp], 31
	jle	.L10
	add	DWORD PTR -24[rbp], 1
.L8:
	mov	eax, DWORD PTR -44[rbp]
	cmp	DWORD PTR -24[rbp], eax
	jb	.L11
	nop
.L5:
	mov	rbx, QWORD PTR -8[rbp]
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	numToBits, .-numToBits
	.section	.rodata
.LC2:
	.string	" %9d (%8X) => "
.LC3:
	.string	"%d"
	.text
	.globl	doTest
	.type	doTest, @function
doTest:
.LFB8:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	push	rbx
	sub	rsp, 56
	.cfi_offset 3, -24
	mov	QWORD PTR -56[rbp], rdi
	mov	DWORD PTR -60[rbp], esi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -24[rbp], rax
	xor	eax, eax
	mov	rax, rsp
	mov	rbx, rax
	mov	eax, DWORD PTR -60[rbp]
	sal	eax, 5
	movsx	rdx, eax
	sub	rdx, 1
	mov	QWORD PTR -40[rbp], rdx
	movsx	rdx, eax
	mov	r10, rdx
	mov	r11d, 0
	movsx	rdx, eax
	mov	r8, rdx
	mov	r9d, 0
	cdqe
	lea	rdx, 0[0+rax*4]
	mov	eax, 16
	sub	rax, 1
	add	rax, rdx
	mov	edi, 16
	mov	edx, 0
	div	rdi
	imul	rax, rax, 16
	mov	rcx, rax
	and	rcx, -4096
	mov	rdx, rsp
	sub	rdx, rcx
.L13:
	cmp	rsp, rdx
	je	.L14
	sub	rsp, 4096
	or	QWORD PTR 4088[rsp], 0
	jmp	.L13
.L14:
	mov	rdx, rax
	and	edx, 4095
	sub	rsp, rdx
	mov	rdx, rax
	and	edx, 4095
	test	rdx, rdx
	je	.L15
	and	eax, 4095
	sub	rax, 8
	add	rax, rsp
	or	QWORD PTR [rax], 0
.L15:
	mov	rax, rsp
	add	rax, 3
	shr	rax, 2
	sal	rax, 2
	mov	QWORD PTR -32[rbp], rax
	mov	eax, DWORD PTR -60[rbp]
	sal	eax, 5
	mov	ecx, eax
	mov	rdx, QWORD PTR -32[rbp]
	mov	esi, DWORD PTR -60[rbp]
	mov	rax, QWORD PTR -56[rbp]
	mov	rdi, rax
	call	numToBits
	mov	DWORD PTR -44[rbp], 0
	jmp	.L16
.L19:
	mov	eax, DWORD PTR -44[rbp]
	cdqe
	lea	rdx, 0[0+rax*4]
	mov	rax, QWORD PTR -56[rbp]
	add	rax, rdx
	mov	edx, DWORD PTR [rax]
	mov	eax, DWORD PTR -44[rbp]
	cdqe
	lea	rcx, 0[0+rax*4]
	mov	rax, QWORD PTR -56[rbp]
	add	rax, rcx
	mov	eax, DWORD PTR [rax]
	mov	esi, eax
	lea	rdi, .LC2[rip]
	mov	eax, 0
	call	printf@PLT
	mov	DWORD PTR -48[rbp], 0
	jmp	.L17
.L18:
	mov	eax, DWORD PTR -44[rbp]
	sal	eax, 5
	mov	edx, eax
	mov	eax, DWORD PTR -48[rbp]
	add	edx, eax
	mov	rax, QWORD PTR -32[rbp]
	movsx	rdx, edx
	mov	eax, DWORD PTR [rax+rdx*4]
	mov	esi, eax
	lea	rdi, .LC3[rip]
	mov	eax, 0
	call	printf@PLT
	add	DWORD PTR -48[rbp], 1
.L17:
	cmp	DWORD PTR -48[rbp], 31
	jle	.L18
	mov	edi, 10
	call	putchar@PLT
	add	DWORD PTR -44[rbp], 1
.L16:
	mov	eax, DWORD PTR -44[rbp]
	cmp	eax, DWORD PTR -60[rbp]
	jl	.L19
	mov	rsp, rbx
	nop
	mov	rax, QWORD PTR -24[rbp]
	sub	rax, QWORD PTR fs:40
	je	.L20
	call	__stack_chk_fail@PLT
.L20:
	mov	rbx, QWORD PTR -8[rbp]
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	doTest, .-doTest
	.globl	main
	.type	main, @function
main:
.LFB9:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 960
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	DWORD PTR -944[rbp], 1
	mov	DWORD PTR -940[rbp], 2
	mov	DWORD PTR -936[rbp], 3
	mov	DWORD PTR -932[rbp], 4
	mov	DWORD PTR -928[rbp], 5
	mov	DWORD PTR -924[rbp], 15
	mov	DWORD PTR -920[rbp], 109
	mov	DWORD PTR -952[rbp], 123456789
	mov	DWORD PTR -948[rbp], 987654321
	lea	rax, -944[rbp]
	mov	esi, 7
	mov	rdi, rax
	call	doTest
	lea	rax, -952[rbp]
	mov	esi, 2
	mov	rdi, rax
	call	doTest
	lea	rdx, -912[rbp]
	lea	rax, -944[rbp]
	mov	ecx, 223
	mov	esi, 7
	mov	rdi, rax
	call	numToBits
	mov	eax, 0
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L23
	call	__stack_chk_fail@PLT
.L23:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 10.5.0-1ubuntu1~20.04) 10.5.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	 1f - 0f
	.long	 4f - 1f
	.long	 5
0:
	.string	 "GNU"
1:
	.align 8
	.long	 0xc0000002
	.long	 3f - 2f
2:
	.long	 0x3
3:
	.align 8
4:

	.arch armv5t
	.eabi_attribute 20, 1
	.eabi_attribute 21, 1
	.eabi_attribute 23, 3
	.eabi_attribute 24, 1
	.eabi_attribute 25, 1
	.eabi_attribute 26, 2
	.eabi_attribute 30, 6
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"40587.c"
	.text
	.section	.rodata
	.align	2
.LC2:
	.ascii	"Bit %d is invalid\012\000"
	.text
	.align	2
	.global	getNthBit
	.syntax unified
	.arm
	.fpu softvfp
	.type	getNthBit, %function
getNthBit:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #8
	str	r0, [fp, #-8]
	str	r1, [fp, #-12]
	ldr	r3, [fp, #-12]
	cmp	r3, #0
	blt	.L2
	ldr	r3, [fp, #-12]
	cmp	r3, #31
	ble	.L3
.L2:
	ldr	r1, [fp, #-12]
	ldr	r0, .L5
	bl	printf
	mov	r0, #1
	bl	exit
.L3:
	mov	r2, #1
	ldr	r3, [fp, #-12]
	lsl	r3, r2, r3
	mov	r2, r3
	ldr	r3, [fp, #-8]
	and	r3, r3, r2
	cmp	r3, #0
	movne	r3, #1
	moveq	r3, #0
	and	r3, r3, #255
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L6:
	.align	2
.L5:
	.word	.LC2
	.size	getNthBit, .-getNthBit
	.section	.rodata
	.align	2
.LC3:
	.ascii	"Invalid call to numToBits! nBits is %d, nNums is %d"
	.ascii	"\012\000"
	.text
	.align	2
	.global	numToBits
	.syntax unified
	.arm
	.fpu softvfp
	.type	numToBits, %function
numToBits:
	@ args = 0, pretend = 0, frame = 24
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, fp, lr}
	add	fp, sp, #8
	sub	sp, sp, #28
	str	r0, [fp, #-24]
	str	r1, [fp, #-28]
	str	r2, [fp, #-32]
	str	r3, [fp, #-36]
	ldr	r3, [fp, #-28]
	lsl	r3, r3, #5
	ldr	r2, [fp, #-36]
	cmp	r2, r3
	bge	.L8
	ldr	r2, [fp, #-28]
	ldr	r1, [fp, #-36]
	ldr	r0, .L14
	bl	printf
	b	.L7
.L8:
	mov	r3, #0
	str	r3, [fp, #-20]
	b	.L10
.L13:
	mov	r3, #0
	str	r3, [fp, #-16]
	b	.L11
.L12:
	ldr	r3, [fp, #-20]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-24]
	add	r3, r2, r3
	ldr	r0, [r3]
	ldr	r3, [fp, #-16]
	rsb	r1, r3, #31
	ldr	r3, [fp, #-20]
	lsl	r2, r3, #5
	ldr	r3, [fp, #-16]
	add	r3, r2, r3
	lsl	r3, r3, #2
	ldr	r2, [fp, #-32]
	add	r4, r2, r3
	bl	getNthBit
	mov	r3, r0
	str	r3, [r4]
	ldr	r3, [fp, #-16]
	add	r3, r3, #1
	str	r3, [fp, #-16]
.L11:
	ldr	r3, [fp, #-16]
	cmp	r3, #31
	ble	.L12
	ldr	r3, [fp, #-20]
	add	r3, r3, #1
	str	r3, [fp, #-20]
.L10:
	ldr	r3, [fp, #-28]
	ldr	r2, [fp, #-20]
	cmp	r2, r3
	bcc	.L13
	nop
.L7:
	sub	sp, fp, #8
	@ sp needed
	pop	{r4, fp, pc}
.L15:
	.align	2
.L14:
	.word	.LC3
	.size	numToBits, .-numToBits
	.section	.rodata
	.align	2
.LC4:
	.ascii	" %9d (%8X) => \000"
	.align	2
.LC5:
	.ascii	"%d\000"
	.align	2
.LC6:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	doTest
	.syntax unified
	.arm
	.fpu softvfp
	.type	doTest, %function
doTest:
	@ args = 0, pretend = 0, frame = 32
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, fp, lr}
	add	fp, sp, #8
	sub	sp, sp, #36
	str	r0, [fp, #-40]
	str	r1, [fp, #-44]
	ldr	r3, .L22
	ldr	r3, [r3]
	str	r3, [fp, #-16]
	mov	r3,#0
	mov	r3, sp
	mov	r4, r3
	ldr	r3, [fp, #-44]
	lsl	ip, r3, #5
	sub	r3, ip, #1
	str	r3, [fp, #-24]
	mov	r3, ip
	mov	r0, r3
	mov	r1, #0
	mov	r2, #0
	mov	r3, #0
	lsl	r3, r1, #5
	orr	r3, r3, r0, lsr #27
	lsl	r2, r0, #5
	mov	r3, ip
	mov	r0, r3
	mov	r1, #0
	mov	r2, #0
	mov	r3, #0
	lsl	r3, r1, #5
	orr	r3, r3, r0, lsr #27
	lsl	r2, r0, #5
	mov	r3, ip
	lsl	r3, r3, #2
	add	r3, r3, #7
	lsr	r3, r3, #3
	lsl	r3, r3, #3
	sub	sp, sp, r3
	mov	r3, sp
	add	r3, r3, #3
	lsr	r3, r3, #2
	lsl	r3, r3, #2
	str	r3, [fp, #-20]
	ldr	r3, [fp, #-44]
	lsl	r3, r3, #5
	ldr	r2, [fp, #-20]
	ldr	r1, [fp, #-44]
	ldr	r0, [fp, #-40]
	bl	numToBits
	mov	r3, #0
	str	r3, [fp, #-28]
	b	.L17
.L20:
	ldr	r3, [fp, #-28]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-40]
	add	r3, r2, r3
	ldr	r1, [r3]
	ldr	r3, [fp, #-28]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-40]
	add	r3, r2, r3
	ldr	r3, [r3]
	mov	r2, r3
	ldr	r0, .L22+4
	bl	printf
	mov	r3, #0
	str	r3, [fp, #-32]
	b	.L18
.L19:
	ldr	r3, [fp, #-28]
	lsl	r2, r3, #5
	ldr	r3, [fp, #-32]
	add	r2, r2, r3
	ldr	r3, [fp, #-20]
	ldr	r3, [r3, r2, lsl #2]
	mov	r1, r3
	ldr	r0, .L22+8
	bl	printf
	ldr	r3, [fp, #-32]
	add	r3, r3, #1
	str	r3, [fp, #-32]
.L18:
	ldr	r3, [fp, #-32]
	cmp	r3, #31
	ble	.L19
	mov	r0, #10
	bl	putchar
	ldr	r3, [fp, #-28]
	add	r3, r3, #1
	str	r3, [fp, #-28]
.L17:
	ldr	r2, [fp, #-28]
	ldr	r3, [fp, #-44]
	cmp	r2, r3
	blt	.L20
	mov	sp, r4
	nop
	ldr	r3, .L22
	ldr	r2, [r3]
	ldr	r3, [fp, #-16]
	eors	r2, r3, r2
	mov	r3, #0
	beq	.L21
	bl	__stack_chk_fail
.L21:
	sub	sp, fp, #8
	@ sp needed
	pop	{r4, fp, pc}
.L23:
	.align	2
.L22:
	.word	.LC6
	.word	.LC4
	.word	.LC5
	.size	doTest, .-doTest
	.section	.rodata
	.align	2
.LC0:
	.word	1
	.word	2
	.word	3
	.word	4
	.word	5
	.word	15
	.word	109
	.align	2
.LC1:
	.word	123456789
	.word	987654321
	.align	2
.LC7:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 936
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #936
	ldr	r3, .L27
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	ldr	r3, .L27+4
	sub	ip, fp, #928
	mov	lr, r3
	ldmia	lr!, {r0, r1, r2, r3}
	stmia	ip!, {r0, r1, r2, r3}
	ldm	lr, {r0, r1, r2}
	stm	ip, {r0, r1, r2}
	ldr	r2, .L27+8
	sub	r3, fp, #936
	ldm	r2, {r0, r1}
	stm	r3, {r0, r1}
	sub	r3, fp, #928
	mov	r1, #7
	mov	r0, r3
	bl	doTest
	sub	r3, fp, #936
	mov	r1, #2
	mov	r0, r3
	bl	doTest
	sub	r2, fp, #900
	sub	r0, fp, #928
	mov	r3, #223
	mov	r1, #7
	bl	numToBits
	mov	r3, #0
	ldr	r2, .L27
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L26
	bl	__stack_chk_fail
.L26:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L28:
	.align	2
.L27:
	.word	.LC7
	.word	.LC0
	.word	.LC1
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
