// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0xe0, %rsp
movq %rdi, -0x28(%rbp)
xorl %eax, %eax
movl %eax, %edi
callq 0x2120
movq %rax, -0x30(%rbp)
leaq -0x30(%rbp), %rdi
leaq -0x68(%rbp), %rsi
callq 0x2060
leaq -0x30(%rbp), %rdi
leaq -0xa0(%rbp), %rsi
callq 0x20e0
movl -0x4c(%rbp), %eax
subl -0x84(%rbp), %eax
cltq
movq %rax, -0xb0(%rbp)
cmpq $0x1, -0xb0(%rbp)
jle 0xc4d9
movq $-0x18, -0xb0(%rbp)
jmp 0xc501
cmpq $-0x1, -0xb0(%rbp)
jge 0xc4f0
movq $0x18, -0xb0(%rbp)
jmp 0xc4ff
imulq $0x18, -0xb0(%rbp), %rax
movq %rax, -0xb0(%rbp)
jmp 0xc501
movq -0xb0(%rbp), %rax
movslq -0x60(%rbp), %rcx
addq %rcx, %rax
movslq -0x98(%rbp), %rcx
subq %rcx, %rax
imulq $0x3c, %rax, %rax
movslq -0x64(%rbp), %rcx
addq %rcx, %rax
movslq -0x9c(%rbp), %rcx
subq %rcx, %rax
movq %rax, -0xb0(%rbp)
movb $0x0, -0xa7(%rbp)
movb $0x2b, -0xb1(%rbp)
movb $0x53, -0xb2(%rbp)
cmpl $0x0, -0x48(%rbp)
je 0xc557
movb $0x44, -0xb2(%rbp)
cmpq $0x0, -0xb0(%rbp)
jge 0xc606
movb $0x2d, -0xb1(%rbp)
xorl %eax, %eax
subq -0xb0(%rbp), %rax
movq %rax, -0xb0(%rbp)
cmpq $0xf0, -0xb0(%rbp)
jl 0xc604
cmpq $0x294, -0xb0(%rbp) # imm = 0x294
jg 0xc604
movq -0xb0(%rbp), %rax
movl $0x3c, %ecx
cqto
idivq %rcx
cmpq $0x0, %rdx
jne 0xc604
leaq -0xa7(%rbp), %rdi
movq -0xb0(%rbp), %rax
movl $0x3c, %ecx
cqto
idivq %rcx
movq %rax, %rcx
movsbl -0xb2(%rbp), %esi
movl $0x4, %eax
movl $0x3, %edx
cmpl $0x44, %esi
cmovel %edx, %eax
cltq
subq %rax, %rcx
leaq 0x6012(%rip), %rax      # 0x125fd
movsbl (%rax,%rcx), %edx
movsbl -0xb2(%rbp), %ecx
leaq 0x5ff7(%rip), %rsi      # 0x125f4
movb $0x0, %al
callq 0x21b0
jmp 0xc606
movq -0x28(%rbp), %rdi
movslq -0x50(%rbp), %rcx
leaq 0x85bb(%rip), %rax      # 0x14bd0
movq (%rax,%rcx,8), %rax
movq %rax, -0xc0(%rbp)
movl -0x5c(%rbp), %ecx
movslq -0x58(%rbp), %rdx
leaq 0x85e2(%rip), %rax      # 0x14c10
movq (%rax,%rdx,8), %r8
movl -0x54(%rbp), %r9d
addl $0x76c, %r9d            # imm = 0x76C
movl -0x60(%rbp), %r12d
movl -0x64(%rbp), %r15d
movl -0x68(%rbp), %r14d
movsbl -0xb1(%rbp), %ebx
movq -0xb0(%rbp), %rax
movl $0x3c, %esi
cqto
idivq %rsi
movq %rax, %r11
movq -0xb0(%rbp), %rax
movl $0x3c, %esi
cqto
idivq %rsi
movq %rdx, %r10
movq -0xc0(%rbp), %rdx
leaq -0xa7(%rbp), %rax
leaq 0x5f79(%rip), %rsi      # 0x12606
movl %r12d, (%rsp)
movl %r15d, 0x8(%rsp)
movl %r14d, 0x10(%rsp)
movl %ebx, 0x18(%rsp)
movq %r11, 0x20(%rsp)
movq %r10, 0x28(%rsp)
movq %rax, 0x30(%rsp)
movb $0x0, %al
callq 0x21b0
addq $0xe0, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
nopw %cs:(%rax,%rax)
nop