	.file	"72013484.c"
	.intel_syntax noprefix
	.text
	.section	.rodata
	.align 8
.LC0:
	.string	"! Purpose: #pragma(pack) produces small structures, but slow code to access them! (interrupt to handle misaligned access)"
	.align 8
.LC1:
	.string	"! Purpose: want to use unaligned structs in a space efficient way\n"
	.align 8
.LC2:
	.string	"! a structure field of uint8_t  can be on any address"
	.align 8
.LC3:
	.string	"! a structure field of uint16_t must be on address divisible by two."
	.align 8
.LC4:
	.string	"! a structure field of uint32_t must be on address divisible by four. (etc)\n"
	.align 8
.LC5:
	.string	"sizeof({ uint16_t, uint8_t })=%zu (%zu,%zu) sizeof({ uint8_t, uint16_t })=%zu (%zu,%zu)\n"
	.align 8
.LC6:
	.string	"! to minimize space: try to pack more than one structure field into the holes between the structure fields\n"
	.align 8
.LC7:
	.string	"sizeof({ char8_t , uint16_t, void* })=%zu (%zu,%zu,%zu)  sizeof({void *, uint16_t, uint8_t })=%u (%zu,%zu,%zu)  sizeof({uint8, void *, uint16 })=%zu (%zu,%zu,%zu)\n"
	.align 8
.LC8:
	.string	"! an array of uint8_t can be on any address (same as uint8_t field)"
	.align 8
.LC9:
	.string	"! an array of uint16_t must start on an address divisibe by two\n"
	.align 8
.LC10:
	.string	"sizeof({uint8[sizeof(void*)+1], uint8_t})=%zu (%zu,%zu) sizeof({uint8_t, uint8_t[sizeof(void*)+1]})=%zu (%zu,%zu)\n"
	.align 8
.LC11:
	.string	"sizeof({uint16_t[3], uint8_t})=%zu (%zu,%zu) sizeof({uint8_t,uint16_t[3]})=%zu (%zu,%zu)\n"
	.align 8
.LC12:
	.string	"! nested structures are a source of some waste of memory due to padding/alignment (hi c++)"
	.align 8
.LC13:
	.string	"! One way is to reorder the structure to fit into a smaller size\n"
	.align 8
.LC14:
	.string	"sizeof({uint8_t, { void *, uint16_t }})=%zu  sizeof({void *, {uint8_t, uint16_t }})=%zu\n"
	.align 8
.LC15:
	.string	"! bitfields: a series of bitfields is aligned to word size (sizeof(int)=%d)\n"
	.align 8
.LC16:
	.string	"! because bitwise instructions are used to implement them (these work on ints)"
	.align 8
.LC17:
	.string	"! common convention to have a padding field that pads up to word size"
	.align 8
.LC18:
	.string	"! also: always use unsigned type for bitfield values"
	.align 8
.LC19:
	.string	"! still: they try to pack them as close as possible (!)\n"
	.align 8
.LC20:
	.string	"sizeof({ uint_t a:3; uint_t b:4; uint8_t c:2; }) = %zu (!!!)\n"
	.align 8
.LC21:
	.string	"sizeof({ uint16_t a:15; uint8_t b:2; })=%zu; sizeof(int)=%zu\n"
	.align 8
.LC22:
	.string	"! bitfield member that does not fit the current word is moved to the next word\n"
	.align 8
.LC23:
	.string	"sizeof({ int a:%d; uint8_t b:2; })=%zu\n"
	.align 8
.LC24:
	.string	"! When in doubt obtain the layout of a struct by means of offsetof (can't take offsetof bitfield members)"
	.align 8
.LC25:
	.string	"! or use clang's -Wpadding or use pahole."
	.align 8
.LC26:
	.string	"! double or long double fields can have surprising behavior"
.LC27:
	.string	"! thank you !"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	lea	rdi, .LC0[rip]
	call	puts@PLT
	lea	rdi, .LC1[rip]
	call	puts@PLT
	lea	rdi, .LC2[rip]
	call	puts@PLT
	lea	rdi, .LC3[rip]
	call	puts@PLT
	lea	rdi, .LC4[rip]
	call	puts@PLT
	sub	rsp, 8
	push	2
	mov	r9d, 0
	mov	r8d, 4
	mov	ecx, 2
	mov	edx, 0
	mov	esi, 4
	lea	rdi, .LC5[rip]
	mov	eax, 0
	call	printf@PLT
	add	rsp, 16
	mov	edi, 10
	call	putchar@PLT
	lea	rdi, .LC6[rip]
	call	puts@PLT
	sub	rsp, 8
	push	16
	push	8
	push	0
	push	24
	push	10
	push	8
	push	0
	mov	r9d, 16
	mov	r8d, 8
	mov	ecx, 2
	mov	edx, 0
	mov	esi, 16
	lea	rdi, .LC7[rip]
	mov	eax, 0
	call	printf@PLT
	add	rsp, 64
	mov	edi, 10
	call	putchar@PLT
	lea	rdi, .LC8[rip]
	call	puts@PLT
	lea	rdi, .LC9[rip]
	call	puts@PLT
	sub	rsp, 8
	push	1
	mov	r9d, 0
	mov	r8d, 10
	mov	ecx, 9
	mov	edx, 0
	mov	esi, 10
	lea	rdi, .LC10[rip]
	mov	eax, 0
	call	printf@PLT
	add	rsp, 16
	sub	rsp, 8
	push	2
	mov	r9d, 0
	mov	r8d, 8
	mov	ecx, 6
	mov	edx, 0
	mov	esi, 8
	lea	rdi, .LC11[rip]
	mov	eax, 0
	call	printf@PLT
	add	rsp, 16
	mov	edi, 10
	call	putchar@PLT
	lea	rdi, .LC12[rip]
	call	puts@PLT
	lea	rdi, .LC13[rip]
	call	puts@PLT
	mov	edx, 16
	mov	esi, 24
	lea	rdi, .LC14[rip]
	mov	eax, 0
	call	printf@PLT
	mov	edi, 10
	call	putchar@PLT
	mov	esi, 4
	lea	rdi, .LC15[rip]
	mov	eax, 0
	call	printf@PLT
	lea	rdi, .LC16[rip]
	call	puts@PLT
	lea	rdi, .LC17[rip]
	call	puts@PLT
	lea	rdi, .LC18[rip]
	call	puts@PLT
	lea	rdi, .LC19[rip]
	call	puts@PLT
	mov	esi, 2
	lea	rdi, .LC20[rip]
	mov	eax, 0
	call	printf@PLT
	mov	edx, 4
	mov	esi, 4
	lea	rdi, .LC21[rip]
	mov	eax, 0
	call	printf@PLT
	mov	edi, 10
	call	putchar@PLT
	lea	rdi, .LC22[rip]
	call	puts@PLT
	mov	edx, 8
	mov	esi, 31
	lea	rdi, .LC23[rip]
	mov	eax, 0
	call	printf@PLT
	mov	edi, 10
	call	putchar@PLT
	lea	rdi, .LC24[rip]
	call	puts@PLT
	lea	rdi, .LC25[rip]
	call	puts@PLT
	lea	rdi, .LC26[rip]
	call	puts@PLT
	mov	edi, 10
	call	putchar@PLT
	lea	rdi, .LC27[rip]
	call	puts@PLT
	mov	eax, 0
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.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	"72013484.c"
	.text
	.section	.rodata
	.align	2
.LC0:
	.ascii	"! Purpose: #pragma(pack) produces small structures,"
	.ascii	" but slow code to access them! (interrupt to handle"
	.ascii	" misaligned access)\000"
	.align	2
.LC1:
	.ascii	"! Purpose: want to use unaligned structs in a space"
	.ascii	" efficient way\012\000"
	.align	2
.LC2:
	.ascii	"! a structure field of uint8_t  can be on any addre"
	.ascii	"ss\000"
	.align	2
.LC3:
	.ascii	"! a structure field of uint16_t must be on address "
	.ascii	"divisible by two.\000"
	.align	2
.LC4:
	.ascii	"! a structure field of uint32_t must be on address "
	.ascii	"divisible by four. (etc)\012\000"
	.align	2
.LC5:
	.ascii	"sizeof({ uint16_t, uint8_t })=%zu (%zu,%zu) sizeof("
	.ascii	"{ uint8_t, uint16_t })=%zu (%zu,%zu)\012\000"
	.align	2
.LC6:
	.ascii	"! to minimize space: try to pack more than one stru"
	.ascii	"cture field into the holes between the structure fi"
	.ascii	"elds\012\000"
	.align	2
.LC7:
	.ascii	"sizeof({ char8_t , uint16_t, void* })=%zu (%zu,%zu,"
	.ascii	"%zu)  sizeof({void *, uint16_t, uint8_t })=%u (%zu,"
	.ascii	"%zu,%zu)  sizeof({uint8, void *, uint16 })=%zu (%zu"
	.ascii	",%zu,%zu)\012\000"
	.align	2
.LC8:
	.ascii	"! an array of uint8_t can be on any address (same a"
	.ascii	"s uint8_t field)\000"
	.align	2
.LC9:
	.ascii	"! an array of uint16_t must start on an address div"
	.ascii	"isibe by two\012\000"
	.align	2
.LC10:
	.ascii	"sizeof({uint8[sizeof(void*)+1], uint8_t})=%zu (%zu,"
	.ascii	"%zu) sizeof({uint8_t, uint8_t[sizeof(void*)+1]})=%z"
	.ascii	"u (%zu,%zu)\012\000"
	.align	2
.LC11:
	.ascii	"sizeof({uint16_t[3], uint8_t})=%zu (%zu,%zu) sizeof"
	.ascii	"({uint8_t,uint16_t[3]})=%zu (%zu,%zu)\012\000"
	.align	2
.LC12:
	.ascii	"! nested structures are a source of some waste of m"
	.ascii	"emory due to padding/alignment (hi c++)\000"
	.align	2
.LC13:
	.ascii	"! One way is to reorder the structure to fit into a"
	.ascii	" smaller size\012\000"
	.align	2
.LC14:
	.ascii	"sizeof({uint8_t, { void *, uint16_t }})=%zu  sizeof"
	.ascii	"({void *, {uint8_t, uint16_t }})=%zu\012\000"
	.align	2
.LC15:
	.ascii	"! bitfields: a series of bitfields is aligned to wo"
	.ascii	"rd size (sizeof(int)=%d)\012\000"
	.align	2
.LC16:
	.ascii	"! because bitwise instructions are used to implemen"
	.ascii	"t them (these work on ints)\000"
	.align	2
.LC17:
	.ascii	"! common convention to have a padding field that pa"
	.ascii	"ds up to word size\000"
	.align	2
.LC18:
	.ascii	"! also: always use unsigned type for bitfield value"
	.ascii	"s\000"
	.align	2
.LC19:
	.ascii	"! still: they try to pack them as close as possible"
	.ascii	" (!)\012\000"
	.align	2
.LC20:
	.ascii	"sizeof({ uint_t a:3; uint_t b:4; uint8_t c:2; }) = "
	.ascii	"%zu (!!!)\012\000"
	.align	2
.LC21:
	.ascii	"sizeof({ uint16_t a:15; uint8_t b:2; })=%zu; sizeof"
	.ascii	"(int)=%zu\012\000"
	.align	2
.LC22:
	.ascii	"! bitfield member that does not fit the current wor"
	.ascii	"d is moved to the next word\012\000"
	.align	2
.LC23:
	.ascii	"sizeof({ int a:%d; uint8_t b:2; })=%zu\012\000"
	.align	2
.LC24:
	.ascii	"! When in doubt obtain the layout of a struct by me"
	.ascii	"ans of offsetof (can't take offsetof bitfield membe"
	.ascii	"rs)\000"
	.align	2
.LC25:
	.ascii	"! or use clang's -Wpadding or use pahole.\000"
	.align	2
.LC26:
	.ascii	"! double or long double fields can have surprising "
	.ascii	"behavior\000"
	.align	2
.LC27:
	.ascii	"! thank you !\000"
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #40
	ldr	r0, .L3
	bl	puts
	ldr	r0, .L3+4
	bl	puts
	ldr	r0, .L3+8
	bl	puts
	ldr	r0, .L3+12
	bl	puts
	ldr	r0, .L3+16
	bl	puts
	mov	r3, #2
	str	r3, [sp, #8]
	mov	r3, #0
	str	r3, [sp, #4]
	mov	r3, #4
	str	r3, [sp]
	mov	r3, #2
	mov	r2, #0
	mov	r1, #4
	ldr	r0, .L3+20
	bl	printf
	mov	r0, #10
	bl	putchar
	ldr	r0, .L3+24
	bl	puts
	mov	r3, #8
	str	r3, [sp, #32]
	mov	r3, #4
	str	r3, [sp, #28]
	mov	r3, #0
	str	r3, [sp, #24]
	mov	r3, #12
	str	r3, [sp, #20]
	mov	r3, #6
	str	r3, [sp, #16]
	mov	r3, #4
	str	r3, [sp, #12]
	mov	r3, #0
	str	r3, [sp, #8]
	mov	r3, #8
	str	r3, [sp, #4]
	mov	r3, #4
	str	r3, [sp]
	mov	r3, #2
	mov	r2, #0
	mov	r1, #8
	ldr	r0, .L3+28
	bl	printf
	mov	r0, #10
	bl	putchar
	ldr	r0, .L3+32
	bl	puts
	ldr	r0, .L3+36
	bl	puts
	mov	r3, #1
	str	r3, [sp, #8]
	mov	r3, #0
	str	r3, [sp, #4]
	mov	r3, #6
	str	r3, [sp]
	mov	r3, #5
	mov	r2, #0
	mov	r1, #6
	ldr	r0, .L3+40
	bl	printf
	mov	r3, #2
	str	r3, [sp, #8]
	mov	r3, #0
	str	r3, [sp, #4]
	mov	r3, #8
	str	r3, [sp]
	mov	r3, #6
	mov	r2, #0
	mov	r1, #8
	ldr	r0, .L3+44
	bl	printf
	mov	r0, #10
	bl	putchar
	ldr	r0, .L3+48
	bl	puts
	ldr	r0, .L3+52
	bl	puts
	mov	r2, #8
	mov	r1, #12
	ldr	r0, .L3+56
	bl	printf
	mov	r0, #10
	bl	putchar
	mov	r1, #4
	ldr	r0, .L3+60
	bl	printf
	ldr	r0, .L3+64
	bl	puts
	ldr	r0, .L3+68
	bl	puts
	ldr	r0, .L3+72
	bl	puts
	ldr	r0, .L3+76
	bl	puts
	mov	r1, #2
	ldr	r0, .L3+80
	bl	printf
	mov	r2, #4
	mov	r1, #4
	ldr	r0, .L3+84
	bl	printf
	mov	r0, #10
	bl	putchar
	ldr	r0, .L3+88
	bl	puts
	mov	r2, #8
	mov	r1, #31
	ldr	r0, .L3+92
	bl	printf
	mov	r0, #10
	bl	putchar
	ldr	r0, .L3+96
	bl	puts
	ldr	r0, .L3+100
	bl	puts
	ldr	r0, .L3+104
	bl	puts
	mov	r0, #10
	bl	putchar
	ldr	r0, .L3+108
	bl	puts
	mov	r3, #0
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L4:
	.align	2
.L3:
	.word	.LC0
	.word	.LC1
	.word	.LC2
	.word	.LC3
	.word	.LC4
	.word	.LC5
	.word	.LC6
	.word	.LC7
	.word	.LC8
	.word	.LC9
	.word	.LC10
	.word	.LC11
	.word	.LC12
	.word	.LC13
	.word	.LC14
	.word	.LC15
	.word	.LC16
	.word	.LC17
	.word	.LC18
	.word	.LC19
	.word	.LC20
	.word	.LC21
	.word	.LC22
	.word	.LC23
	.word	.LC24
	.word	.LC25
	.word	.LC26
	.word	.LC27
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
