// File: /workspace/github_c_makefile_star2_O0/johsteffens[P]beth/lib/bcore/bcore_cday.c
// Function: bcore_cday_ymd_s_from_source
void bcore_cday_ymd_s_from_source( bcore_cday_ymd_s* o, bcore_source* source )
{
    char y[4] = { 0 };
    char m[2] = { 0 };
    char d[2] = { 0 };

    // We deliberately parse characters (rather than using direct integer conversions) in order to enforce the correct format.
    bcore_source_a_parse_fa( source, "#<char*>#<char*>#<char*>#<char*>-#<char*>#<char*>-#<char*>#<char*>", &y[0], &y[1], &y[2], &y[3], &m[0], &m[1], &d[0], &d[1] );

    for( sz_t i = 0; i < 4; i++ ) ASSERT( y[i] >= '0' && y[i] <= '9' );
    for( sz_t i = 0; i < 2; i++ ) ASSERT( m[i] >= '0' && m[i] <= '9' );
    for( sz_t i = 0; i < 2; i++ ) ASSERT( d[i] >= '0' && d[i] <= '9' );

    o->y = ( y[0] - '0' ) * 1000 + ( y[1] - '0' ) * 100 + ( y[2] - '0' ) * 10 + ( y[3] - '0' );
    o->m = ( m[0] - '0' ) * 10   + ( m[1] - '0' );
    o->d = ( d[0] - '0' ) * 10   + ( d[1] - '0' );

    bcore_cday_ymd_s_check_plausibility( o );
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
subq $0x58, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
leaq -0x1c(%rbp), %rdi
xorl %esi, %esi
movl $0x4, %edx
callq 0x4090
leaq -0x1e(%rbp), %rdi
xorl %esi, %esi
movl $0x2, %edx
callq 0x4090
leaq -0x20(%rbp), %rdi
xorl %esi, %esi
movl $0x2, %edx
callq 0x4090
movq -0x18(%rbp), %rdi
leaq -0x1c(%rbp), %rdx
leaq -0x1c(%rbp), %rcx
addq $0x1, %rcx
leaq -0x1c(%rbp), %r8
addq $0x2, %r8
leaq -0x1c(%rbp), %r9
addq $0x3, %r9
leaq -0x1e(%rbp), %rbx
leaq -0x1e(%rbp), %r11
addq $0x1, %r11
leaq -0x20(%rbp), %r10
leaq -0x20(%rbp), %rax
addq $0x1, %rax
leaq 0xb202b(%rip), %rsi     # 0x14cffb
movq %rbx, (%rsp)
movq %r11, 0x8(%rsp)
movq %r10, 0x10(%rsp)
movq %rax, 0x18(%rsp)
movb $0x0, %al
callq 0xf3450
movq $0x0, -0x28(%rbp)
cmpq $0x4, -0x28(%rbp)
jge 0x9b04e
movq -0x28(%rbp), %rax
movsbl -0x1c(%rbp,%rax), %eax
cmpl $0x30, %eax
jl 0x9b015
movq -0x28(%rbp), %rax
movsbl -0x1c(%rbp,%rax), %eax
cmpl $0x39, %eax
jle 0x9b03e
leaq 0x98983(%rip), %rdi     # 0x13399f
leaq 0xb201b(%rip), %rsi     # 0x14d03e
leaq 0xb202f(%rip), %rdx     # 0x14d059
leaq 0xb1f64(%rip), %rcx     # 0x14cf95
movl $0x56, %r8d
movb $0x0, %al
callq 0x9cea0
jmp 0x9b040
movq -0x28(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
jmp 0x9aff2
movq $0x0, -0x30(%rbp)
cmpq $0x2, -0x30(%rbp)
jge 0x9b0b2
movq -0x30(%rbp), %rax
movsbl -0x1e(%rbp,%rax), %eax
cmpl $0x30, %eax
jl 0x9b079
movq -0x30(%rbp), %rax
movsbl -0x1e(%rbp,%rax), %eax
cmpl $0x39, %eax
jle 0x9b0a2
leaq 0x9891f(%rip), %rdi     # 0x13399f
leaq 0xb1fef(%rip), %rsi     # 0x14d076
leaq 0xb1fcb(%rip), %rdx     # 0x14d059
leaq 0xb1f00(%rip), %rcx     # 0x14cf95
movl $0x57, %r8d
movb $0x0, %al
callq 0x9cea0
jmp 0x9b0a4
movq -0x30(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x30(%rbp)
jmp 0x9b056
movq $0x0, -0x38(%rbp)
cmpq $0x2, -0x38(%rbp)
jge 0x9b116
movq -0x38(%rbp), %rax
movsbl -0x20(%rbp,%rax), %eax
cmpl $0x30, %eax
jl 0x9b0dd
movq -0x38(%rbp), %rax
movsbl -0x20(%rbp,%rax), %eax
cmpl $0x39, %eax
jle 0x9b106
leaq 0x988bb(%rip), %rdi     # 0x13399f
leaq 0xb1fa6(%rip), %rsi     # 0x14d091
leaq 0xb1f67(%rip), %rdx     # 0x14d059
leaq 0xb1e9c(%rip), %rcx     # 0x14cf95
movl $0x58, %r8d
movb $0x0, %al
callq 0x9cea0
jmp 0x9b108
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
jmp 0x9b0ba
movsbl -0x1c(%rbp), %eax
subl $0x30, %eax
imull $0x3e8, %eax, %ecx      # imm = 0x3E8
movsbl -0x1b(%rbp), %eax
subl $0x30, %eax
imull $0x64, %eax, %eax
addl %eax, %ecx
movsbl -0x1a(%rbp), %eax
subl $0x30, %eax
imull $0xa, %eax, %eax
addl %eax, %ecx
movsbl -0x19(%rbp), %eax
subl $0x30, %eax
addl %eax, %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x8(%rax)
movsbl -0x1e(%rbp), %eax
subl $0x30, %eax
imull $0xa, %eax, %ecx
movsbl -0x1d(%rbp), %eax
subl $0x30, %eax
addl %eax, %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0xc(%rax)
movsbl -0x20(%rbp), %eax
subl $0x30, %eax
imull $0xa, %eax, %ecx
movsbl -0x1f(%rbp), %eax
subl $0x30, %eax
addl %eax, %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x10(%rax)
movq -0x10(%rbp), %rdi
callq 0x9aa00
addq $0x58, %rsp
popq %rbx
popq %rbp
retq
nop