	.file	"207964.c"
	.intel_syntax noprefix
	.text
	.globl	function_1
	.type	function_1, @function
function_1:
.LFB0:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	mov	DWORD PTR -4[rbp], edi
	mov	DWORD PTR -8[rbp], esi
	mov	eax, DWORD PTR -4[rbp]
	lea	ecx, [rax+rax]
	mov	edx, DWORD PTR -8[rbp]
	mov	eax, edx
	add	eax, eax
	add	eax, edx
	lea	edx, [rcx+rax]
	mov	eax, DWORD PTR -4[rbp]
	imul	eax, DWORD PTR -8[rbp]
	sal	eax, 2
	lea	ecx, [rdx+rax]
	mov	eax, DWORD PTR -4[rbp]
	imul	eax, DWORD PTR -8[rbp]
	mov	edx, eax
	mov	eax, edx
	sal	eax, 2
	add	eax, edx
	neg	eax
	add	eax, ecx
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	function_1, .-function_1
	.section	.rodata
.LC0:
	.string	"macro_1(%d) = %d\n\n"
	.align 8
.LC1:
	.string	"Explanation: Judging from the code, ++m incraments the value then passes it, while m++ passes the original value first and then it prints it, this saves us the double incremintation.\n\n"
	.text
	.globl	part1
	.type	part1, @function
part1:
.LFB1:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 32
	mov	DWORD PTR -20[rbp], edi
	mov	eax, DWORD PTR -20[rbp]
	mov	DWORD PTR -8[rbp], eax
	mov	eax, DWORD PTR -8[rbp]
	lea	edx, 1[rax]
	mov	DWORD PTR -8[rbp], edx
	test	eax, eax
	jle	.L4
	mov	eax, DWORD PTR -8[rbp]
	lea	edx, 1[rax]
	mov	DWORD PTR -8[rbp], edx
	jmp	.L5
.L4:
	mov	eax, 0
.L5:
	mov	DWORD PTR -4[rbp], eax
	add	DWORD PTR -20[rbp], 1
	mov	edx, DWORD PTR -4[rbp]
	mov	eax, DWORD PTR -20[rbp]
	mov	esi, eax
	lea	rdi, .LC0[rip]
	mov	eax, 0
	call	printf@PLT
	lea	rdi, .LC1[rip]
	call	puts@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	part1, .-part1
	.section	.rodata
	.align 8
.LC2:
	.string	"function_1(x, y) = %d\nmacro_2(x, y) = %d\n\n"
	.align 8
.LC3:
	.string	"In VS : the result of function_1(x, y) = -2 and macro_2(x, y) = -18 "
	.align 8
.LC4:
	.string	"In GCC: the result of function_1(x, y) = -2 and macro_2(x, y) = -84 \n"
	.align 8
.LC5:
	.ascii	"Explanation: One explination for the variation could be attr"
	.ascii	"ibuted to how the macro equations expand (order of"
	.string	" evaluation & value production). The order of evaluation is completely compiler dependent so in this case the way GCC goes through the macro could be different from VS. Adding auto keywords such as ++ could be buggy when moving from compiler to compiler. \n"
	.text
	.globl	part2
	.type	part2, @function
part2:
.LFB2:
	.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, 40
	.cfi_offset 3, -24
	mov	DWORD PTR -36[rbp], edi
	mov	DWORD PTR -40[rbp], esi
	mov	eax, DWORD PTR -36[rbp]
	mov	DWORD PTR -32[rbp], eax
	mov	eax, DWORD PTR -32[rbp]
	mov	DWORD PTR -28[rbp], eax
	mov	eax, DWORD PTR -40[rbp]
	mov	DWORD PTR -24[rbp], eax
	mov	eax, DWORD PTR -24[rbp]
	mov	DWORD PTR -20[rbp], eax
	add	DWORD PTR -28[rbp], 1
	mov	eax, DWORD PTR -28[rbp]
	lea	ecx, [rax+rax]
	add	DWORD PTR -20[rbp], 1
	mov	edx, DWORD PTR -20[rbp]
	mov	eax, edx
	add	eax, eax
	add	eax, edx
	lea	edx, [rcx+rax]
	add	DWORD PTR -28[rbp], 1
	add	DWORD PTR -20[rbp], 1
	mov	eax, DWORD PTR -28[rbp]
	imul	eax, DWORD PTR -20[rbp]
	sal	eax, 2
	lea	ecx, [rdx+rax]
	add	DWORD PTR -28[rbp], 1
	add	DWORD PTR -20[rbp], 1
	mov	eax, DWORD PTR -28[rbp]
	imul	eax, DWORD PTR -20[rbp]
	mov	edx, eax
	mov	eax, edx
	sal	eax, 2
	add	eax, edx
	neg	eax
	lea	ebx, [rcx+rax]
	add	DWORD PTR -24[rbp], 1
	add	DWORD PTR -32[rbp], 1
	mov	edx, DWORD PTR -24[rbp]
	mov	eax, DWORD PTR -32[rbp]
	mov	esi, edx
	mov	edi, eax
	call	function_1
	mov	edx, ebx
	mov	esi, eax
	lea	rdi, .LC2[rip]
	mov	eax, 0
	call	printf@PLT
	lea	rdi, .LC3[rip]
	call	puts@PLT
	lea	rdi, .LC4[rip]
	call	puts@PLT
	lea	rdi, .LC5[rip]
	call	puts@PLT
	nop
	mov	rbx, QWORD PTR -8[rbp]
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.size	part2, .-part2
	.section	.rodata
.LC6:
	.string	"Part 1:\n"
.LC7:
	.string	"Part 2:\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB3:
	.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 -8[rbp], 4
	mov	DWORD PTR -4[rbp], 5
	lea	rdi, .LC6[rip]
	call	puts@PLT
	mov	eax, DWORD PTR -8[rbp]
	mov	edi, eax
	call	part1
	lea	rdi, .LC7[rip]
	call	puts@PLT
	mov	edx, DWORD PTR -4[rbp]
	mov	eax, DWORD PTR -8[rbp]
	mov	esi, edx
	mov	edi, eax
	call	part2
	mov	eax, 0
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE3:
	.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	"207964.c"
	.text
	.align	2
	.global	function_1
	.syntax unified
	.arm
	.fpu softvfp
	.type	function_1, %function
function_1:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 1, uses_anonymous_args = 0
	@ link register save eliminated.
	str	fp, [sp, #-4]!
	add	fp, sp, #0
	sub	sp, sp, #12
	str	r0, [fp, #-8]
	str	r1, [fp, #-12]
	ldr	r3, [fp, #-8]
	lsl	r1, r3, #1
	ldr	r2, [fp, #-12]
	mov	r3, r2
	lsl	r3, r3, #1
	add	r3, r3, r2
	add	r2, r1, r3
	ldr	r3, [fp, #-8]
	ldr	r1, [fp, #-12]
	mul	r3, r1, r3
	lsl	r3, r3, #2
	add	r1, r2, r3
	ldr	r3, [fp, #-8]
	ldr	r2, [fp, #-12]
	mul	r2, r3, r2
	mov	r3, r2
	lsl	r3, r3, #30
	sub	r3, r3, r2
	lsl	r3, r3, #2
	sub	r3, r3, r2
	add	r3, r1, r3
	mov	r0, r3
	add	sp, fp, #0
	@ sp needed
	ldr	fp, [sp], #4
	bx	lr
	.size	function_1, .-function_1
	.section	.rodata
	.align	2
.LC0:
	.ascii	"macro_1(%d) = %d\012\012\000"
	.align	2
.LC1:
	.ascii	"Explanation: Judging from the code, ++m incraments "
	.ascii	"the value then passes it, while m++ passes the orig"
	.ascii	"inal value first and then it prints it, this saves "
	.ascii	"us the double incremintation.\012\012\000"
	.text
	.align	2
	.global	part1
	.syntax unified
	.arm
	.fpu softvfp
	.type	part1, %function
part1:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #16
	str	r0, [fp, #-16]
	ldr	r3, [fp, #-16]
	str	r3, [fp, #-12]
	ldr	r3, [fp, #-12]
	add	r2, r3, #1
	str	r2, [fp, #-12]
	cmp	r3, #0
	ble	.L4
	ldr	r3, [fp, #-12]
	add	r2, r3, #1
	str	r2, [fp, #-12]
	b	.L5
.L4:
	mov	r3, #0
.L5:
	str	r3, [fp, #-8]
	ldr	r3, [fp, #-16]
	add	r3, r3, #1
	str	r3, [fp, #-16]
	ldr	r2, [fp, #-8]
	ldr	r1, [fp, #-16]
	ldr	r0, .L6
	bl	printf
	ldr	r0, .L6+4
	bl	puts
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L7:
	.align	2
.L6:
	.word	.LC0
	.word	.LC1
	.size	part1, .-part1
	.section	.rodata
	.align	2
.LC2:
	.ascii	"function_1(x, y) = %d\012macro_2(x, y) = %d\012\012"
	.ascii	"\000"
	.align	2
.LC3:
	.ascii	"In VS : the result of function_1(x, y) = -2 and mac"
	.ascii	"ro_2(x, y) = -18 \000"
	.align	2
.LC4:
	.ascii	"In GCC: the result of function_1(x, y) = -2 and mac"
	.ascii	"ro_2(x, y) = -84 \012\000"
	.align	2
.LC5:
	.ascii	"Explanation: One explination for the variation coul"
	.ascii	"d be attributed to how the macro equations expand ("
	.ascii	"order of evaluation & value production). The order "
	.ascii	"of evaluation is completely compiler dependent so i"
	.ascii	"n this case the way GCC goes through the macro coul"
	.ascii	"d be different from VS. Adding auto keywords such a"
	.ascii	"s ++ could be buggy when moving from compiler to co"
	.ascii	"mpiler. \012\000"
	.text
	.align	2
	.global	part2
	.syntax unified
	.arm
	.fpu softvfp
	.type	part2, %function
part2:
	@ args = 0, pretend = 0, frame = 24
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #24
	str	r0, [fp, #-24]
	str	r1, [fp, #-28]
	ldr	r3, [fp, #-24]
	str	r3, [fp, #-20]
	ldr	r3, [fp, #-20]
	str	r3, [fp, #-16]
	ldr	r3, [fp, #-28]
	str	r3, [fp, #-12]
	ldr	r3, [fp, #-12]
	str	r3, [fp, #-8]
	ldr	r3, [fp, #-20]
	add	r3, r3, #1
	str	r3, [fp, #-20]
	ldr	r3, [fp, #-12]
	add	r3, r3, #1
	str	r3, [fp, #-12]
	ldr	r1, [fp, #-12]
	ldr	r0, [fp, #-20]
	bl	function_1
	ldr	r3, [fp, #-16]
	add	r3, r3, #1
	str	r3, [fp, #-16]
	ldr	r3, [fp, #-16]
	lsl	r1, r3, #1
	ldr	r3, [fp, #-8]
	add	r3, r3, #1
	str	r3, [fp, #-8]
	ldr	r2, [fp, #-8]
	mov	r3, r2
	lsl	r3, r3, #1
	add	r3, r3, r2
	add	r2, r1, r3
	ldr	r3, [fp, #-16]
	add	r3, r3, #1
	str	r3, [fp, #-16]
	ldr	r3, [fp, #-8]
	add	r3, r3, #1
	str	r3, [fp, #-8]
	ldr	r3, [fp, #-16]
	ldr	r1, [fp, #-8]
	mul	r3, r1, r3
	lsl	r3, r3, #2
	add	r1, r2, r3
	ldr	r3, [fp, #-16]
	add	r3, r3, #1
	str	r3, [fp, #-16]
	ldr	r3, [fp, #-8]
	add	r3, r3, #1
	str	r3, [fp, #-8]
	ldr	r3, [fp, #-16]
	ldr	r2, [fp, #-8]
	mul	r2, r3, r2
	mov	r3, r2
	lsl	r3, r3, #30
	sub	r3, r3, r2
	lsl	r3, r3, #2
	sub	r3, r3, r2
	add	r3, r1, r3
	mov	r2, r3
	mov	r1, r0
	ldr	r0, .L9
	bl	printf
	ldr	r0, .L9+4
	bl	puts
	ldr	r0, .L9+8
	bl	puts
	ldr	r0, .L9+12
	bl	puts
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L10:
	.align	2
.L9:
	.word	.LC2
	.word	.LC3
	.word	.LC4
	.word	.LC5
	.size	part2, .-part2
	.section	.rodata
	.align	2
.LC6:
	.ascii	"Part 1:\012\000"
	.align	2
.LC7:
	.ascii	"Part 2:\012\000"
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #8
	mov	r3, #4
	str	r3, [fp, #-12]
	mov	r3, #5
	str	r3, [fp, #-8]
	ldr	r0, .L13
	bl	puts
	ldr	r0, [fp, #-12]
	bl	part1
	ldr	r0, .L13+4
	bl	puts
	ldr	r1, [fp, #-8]
	ldr	r0, [fp, #-12]
	bl	part2
	mov	r3, #0
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L14:
	.align	2
.L13:
	.word	.LC6
	.word	.LC7
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
