There are some but not all possible size optimizations applied to the assembly code.
401000: 31 c0 xor %eax,%eax
401002: b0 01 mov $0x1,%al
401004: 89 c7 mov %eax,%edi
401006: be 00 10 40 00 mov $0x401000,%esi
40100b: 31 d2 xor %edx,%edx
40100d: b2 07 mov $0x7,%dl
40100f: 0f 05 syscall
401011: 31 ff xor %edi,%edi
401013: b0 3c mov $0x3c,%al
401015: 0f 05 syscall
There are some but not all possible size optimizations applied to the assembly code.
One can:
With them the code boils down to 23 bytes: