// File: /workspace/github_c_makefile_star2_O1/NedFreed[P]msglint/imaildate.c
// Function: n_maildate
void n_maildate(char *buf)
{
    time_t now;
    struct tm local, gmt;
    char tzbuf[ZONESIZE];
    long zminutes;
    char zsign, zdst;

    /* get time */
    now = time(NULL);
#ifdef __APPLE__
    local = *localtime(&now);
    gmt = *gmtime(&now);
#else
    localtime_r(&now, &local);
    gmtime_r(&now, &gmt);
#endif
    
    /* get GMT offset */
    zminutes = local.tm_yday - gmt.tm_yday;
    if (zminutes > 1) {
	zminutes = -24;
    } else if (zminutes < -1) {
	zminutes = 24;
    } else {
	zminutes *= 24;
    }
    zminutes = (zminutes + local.tm_hour - gmt.tm_hour) * 60
	+ local.tm_min - gmt.tm_min;

    /* create timezone */
    *tzbuf = '\0';
    zsign = '+';
    zdst = 'S';
    if (local.tm_isdst) {
	zdst = 'D';
    }
    if (zminutes < 0) {
	zsign = '-';
	zminutes = -zminutes;
	if (zminutes >= 240 && zminutes <= 660 && zminutes % 60 == 0) {
	    sprintf(tzbuf, " (%c%cT)", "AECMPYHB"
		    [(zminutes / 60) - (zdst == 'D' ? 3 : 4)], zdst);
	}
    }

    /* create Internet date */
    sprintf(buf, "%s, %d %s %d %02d:%02d:%02d %c%02ld%02ld%s",
	    dayofweek[local.tm_wday],
	    local.tm_mday,
	    month[local.tm_mon],
	    local.tm_year + 1900,
	    local.tm_hour, local.tm_min, local.tm_sec,
	    zsign, (unsigned long) (zminutes / 60),
	    (unsigned long) (zminutes % 60), tzbuf);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movq %rdi, 0x8(%rsp)
xorl %edi, %edi
callq 0x2130
leaq 0x48(%rsp), %r15
movq %rax, (%r15)
leaq 0x10(%rsp), %r14
movq %r15, %rdi
movq %r14, %rsi
callq 0x2060
leaq 0x50(%rsp), %r12
movq %r15, %rdi
movq %r12, %rsi
callq 0x20d0
movslq 0x1c(%r14), %rax
movslq 0x1c(%r12), %rcx
subq %rcx, %rax
movq %rax, %rcx
shlq $0x3, %rcx
cmpl $-0x1, %eax
leaq (%rcx,%rcx,2), %rcx
movl $0x18, %edx
cmovgeq %rcx, %rdx
cmpl $0x2, %eax
movq $-0x18, %rax
cmovlq %rdx, %rax
movslq 0x8(%r14), %rcx
movslq 0x8(%r12), %rdx
subq %rdx, %rcx
addq %rax, %rcx
imulq $0x3c, %rcx, %rax
movslq 0x4(%r14), %rcx
movslq 0x4(%r12), %rdx
subq %rdx, %rcx
addq %rax, %rcx
movb $0x0, 0x1(%rsp)
movl $0x2b, %r15d
movabsq $-0x7777777777777777, %rbx # imm = 0x8888888888888889
js 0x9d3c
movq %rcx, %r14
jmp 0x9daa
movq %rcx, %r14
negq %r14
movq %r14, %rax
mulq %rbx
addq $0x294, %rcx            # imm = 0x294
movl $0x2d, %r15d
cmpq $0x1a4, %rcx            # imm = 0x1A4
ja 0x9daa
shrq $0x5, %rdx
imulq $0x3c, %rdx, %rax
movq %r14, %rcx
subq %rax, %rcx
jne 0x9daa
xorl %eax, %eax
cmpl $0x0, 0x30(%rsp)
sete %al
movl $0x53, %esi
movl $0x44, %ecx
cmovel %esi, %ecx
xorq $-0x3, %rax
addq %rax, %rdx
leaq 0x54ae(%rip), %rax      # 0xf241
movsbl (%rax,%rdx), %edx
leaq 0x549a(%rip), %rsi      # 0xf238
leaq 0x1(%rsp), %rdi
xorl %eax, %eax
callq 0x21c0
movslq 0x28(%rsp), %rax
leaq 0x550e(%rip), %rcx      # 0xf2c4
movslq (%rcx,%rax,4), %r10
addq %rcx, %r10
movl 0x1c(%rsp), %ecx
movslq 0x20(%rsp), %rax
leaq 0x5513(%rip), %rdx      # 0xf2e0
movslq (%rdx,%rax,4), %r8
addq %rdx, %r8
movl $0x76c, %r9d            # imm = 0x76C
addl 0x24(%rsp), %r9d
movl 0x18(%rsp), %r13d
movl 0x10(%rsp), %r12d
movl 0x14(%rsp), %ebp
movq %r14, %rax
mulq %rbx
movq %rdx, %r11
shrq $0x5, %r11
imulq $0x3c, %r11, %rax
subq %rax, %r14
subq $0x8, %rsp
leaq 0x9(%rsp), %rbx
leaq 0x5439(%rip), %rsi      # 0xf24a
movq 0x10(%rsp), %rdi
movq %r10, %rdx
xorl %eax, %eax
pushq %rbx
pushq %r14
pushq %r11
pushq %r15
pushq %r12
pushq %rbp
pushq %r13
callq 0x21c0
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop