// File: /workspace/github_c_makefile_star2_O0/jeff-1amstudios[P]carmageddon-1-cheat-code-disassembly/src/log/zf_log.c
// Function: put_ctx
static void put_ctx(zf_log_message *const msg)
{
    _PP_MAP(_ZF_LOG_MESSAGE_FORMAT_INIT, ZF_LOG_MESSAGE_CTX_FORMAT)
#if !_ZF_LOG_MESSAGE_FORMAT_FIELDS(ZF_LOG_MESSAGE_CTX_FORMAT)
    VAR_UNUSED(msg);
#else
    #if _ZF_LOG_MESSAGE_FORMAT_DATETIME_USED
    struct tm tm;
    unsigned msec;
    g_time_cb(&tm, &msec);
    #endif
    #if _ZF_LOG_MESSAGE_FORMAT_CONTAINS(PID, ZF_LOG_MESSAGE_CTX_FORMAT) || \
        _ZF_LOG_MESSAGE_FORMAT_CONTAINS(TID, ZF_LOG_MESSAGE_CTX_FORMAT)
    int pid, tid;
    g_pid_cb(&pid, &tid);
    #endif

    #if ZF_LOG_OPTIMIZE_SIZE
    int n;
    n = snprintf(msg->p, nprintf_size(msg),
                 _PP_MAP(_ZF_LOG_MESSAGE_FORMAT_PRINTF_FMT, ZF_LOG_MESSAGE_CTX_FORMAT)
                 _PP_MAP(_ZF_LOG_MESSAGE_FORMAT_PRINTF_VAL, ZF_LOG_MESSAGE_CTX_FORMAT));
    put_nprintf(msg, n);
    #else
    char buf[64];
    char *const e = buf + sizeof(buf);
    char *p = e;
    _PP_RMAP(_ZF_LOG_MESSAGE_FORMAT_PUT_R, ZF_LOG_MESSAGE_CTX_FORMAT)
    msg->p = put_stringn(p, e, msg->p, msg->e);
    #endif
#endif
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xd0, %rsp
movq %rdi, -0x8(%rbp)
leaq -0x40(%rbp), %rdi
leaq -0x44(%rbp), %rsi
callq 0x4810
leaq -0x48(%rbp), %rdi
leaq -0x4c(%rbp), %rsi
callq 0x4880
leaq -0x90(%rbp), %rax
addq $0x40, %rax
movq %rax, -0x98(%rbp)
movq -0x98(%rbp), %rax
movq %rax, -0xa0(%rbp)
movl $0x1, -0xa4(%rbp)
movl -0xa4(%rbp), %ecx
movl %ecx, %eax
addl $-0x1, %eax
movl %eax, -0xa4(%rbp)
xorl %eax, %eax
cmpl %ecx, %eax
jae 0x3d96
movl -0xa4(%rbp), %eax
movl %eax, %ecx
leaq 0x6874(%rip), %rax      # 0xa5ed
movb (%rax,%rcx), %cl
movq -0xa0(%rbp), %rax
movq %rax, %rdx
addq $-0x1, %rdx
movq %rdx, -0xa0(%rbp)
movb %cl, -0x1(%rax)
jmp 0x3d53
jmp 0x3d98
movq -0x8(%rbp), %rax
movl (%rax), %edi
callq 0x48c0
movb %al, %cl
movq -0xa0(%rbp), %rax
movq %rax, %rdx
addq $-0x1, %rdx
movq %rdx, -0xa0(%rbp)
movb %cl, -0x1(%rax)
movl $0x1, -0xa8(%rbp)
movl -0xa8(%rbp), %ecx
movl %ecx, %eax
addl $-0x1, %eax
movl %eax, -0xa8(%rbp)
xorl %eax, %eax
cmpl %ecx, %eax
jae 0x3e0a
movl -0xa8(%rbp), %eax
movl %eax, %ecx
leaq 0x6800(%rip), %rax      # 0xa5ed
movb (%rax,%rcx), %cl
movq -0xa0(%rbp), %rax
movq %rax, %rdx
addq $-0x1, %rdx
movq %rdx, -0xa0(%rbp)
movb %cl, -0x1(%rax)
jmp 0x3dc7
jmp 0x3e0c
movl -0x4c(%rbp), %edi
movq -0xa0(%rbp), %rcx
movl $0x5, %esi
movl $0x20, %edx
callq 0x4940
movq %rax, -0xa0(%rbp)
movl $0x1, -0xac(%rbp)
movl -0xac(%rbp), %ecx
movl %ecx, %eax
addl $-0x1, %eax
movl %eax, -0xac(%rbp)
xorl %eax, %eax
cmpl %ecx, %eax
jae 0x3e79
movl -0xac(%rbp), %eax
movl %eax, %ecx
leaq 0x6791(%rip), %rax      # 0xa5ed
movb (%rax,%rcx), %cl
movq -0xa0(%rbp), %rax
movq %rax, %rdx
addq $-0x1, %rdx
movq %rdx, -0xa0(%rbp)
movb %cl, -0x1(%rax)
jmp 0x3e36
jmp 0x3e7b
movl -0x48(%rbp), %edi
movq -0xa0(%rbp), %rcx
movl $0x5, %esi
movl $0x20, %edx
callq 0x4940
movq %rax, -0xa0(%rbp)
movl $0x1, -0xb0(%rbp)
movl -0xb0(%rbp), %ecx
movl %ecx, %eax
addl $-0x1, %eax
movl %eax, -0xb0(%rbp)
xorl %eax, %eax
cmpl %ecx, %eax
jae 0x3ee8
movl -0xb0(%rbp), %eax
movl %eax, %ecx
leaq 0x6722(%rip), %rax      # 0xa5ed
movb (%rax,%rcx), %cl
movq -0xa0(%rbp), %rax
movq %rax, %rdx
addq $-0x1, %rdx
movq %rdx, -0xa0(%rbp)
movb %cl, -0x1(%rax)
jmp 0x3ea5
jmp 0x3eea
movl -0x44(%rbp), %edi
movq -0xa0(%rbp), %rcx
movl $0x3, %esi
movl $0x30, %edx
callq 0x49b0
movq %rax, -0xa0(%rbp)
movl $0x1, -0xb4(%rbp)
movl -0xb4(%rbp), %ecx
movl %ecx, %eax
addl $-0x1, %eax
movl %eax, -0xb4(%rbp)
xorl %eax, %eax
cmpl %ecx, %eax
jae 0x3f57
movl -0xb4(%rbp), %eax
movl %eax, %ecx
leaq 0x520c(%rip), %rax      # 0x9146
movb (%rax,%rcx), %cl
movq -0xa0(%rbp), %rax
movq %rax, %rdx
addq $-0x1, %rdx
movq %rdx, -0xa0(%rbp)
movb %cl, -0x1(%rax)
jmp 0x3f14
jmp 0x3f59
movl -0x40(%rbp), %edi
movq -0xa0(%rbp), %rcx
movl $0x2, %esi
movl $0x30, %edx
callq 0x49b0
movq %rax, -0xa0(%rbp)
movl $0x1, -0xb8(%rbp)
movl -0xb8(%rbp), %ecx
movl %ecx, %eax
addl $-0x1, %eax
movl %eax, -0xb8(%rbp)
xorl %eax, %eax
cmpl %ecx, %eax
jae 0x3fc6
movl -0xb8(%rbp), %eax
movl %eax, %ecx
leaq 0x62a8(%rip), %rax      # 0xa251
movb (%rax,%rcx), %cl
movq -0xa0(%rbp), %rax
movq %rax, %rdx
addq $-0x1, %rdx
movq %rdx, -0xa0(%rbp)
movb %cl, -0x1(%rax)
jmp 0x3f83
jmp 0x3fc8
movl -0x3c(%rbp), %edi
movq -0xa0(%rbp), %rcx
movl $0x2, %esi
movl $0x30, %edx
callq 0x49b0
movq %rax, -0xa0(%rbp)
movl $0x1, -0xbc(%rbp)
movl -0xbc(%rbp), %ecx
movl %ecx, %eax
addl $-0x1, %eax
movl %eax, -0xbc(%rbp)
xorl %eax, %eax
cmpl %ecx, %eax
jae 0x4035
movl -0xbc(%rbp), %eax
movl %eax, %ecx
leaq 0x6239(%rip), %rax      # 0xa251
movb (%rax,%rcx), %cl
movq -0xa0(%rbp), %rax
movq %rax, %rdx
addq $-0x1, %rdx
movq %rdx, -0xa0(%rbp)
movb %cl, -0x1(%rax)
jmp 0x3ff2
jmp 0x4037
movl -0x38(%rbp), %edi
movq -0xa0(%rbp), %rcx
movl $0x2, %esi
movl $0x30, %edx
callq 0x49b0
movq %rax, -0xa0(%rbp)
movl $0x1, -0xc0(%rbp)
movl -0xc0(%rbp), %ecx
movl %ecx, %eax
addl $-0x1, %eax
movl %eax, -0xc0(%rbp)
xorl %eax, %eax
cmpl %ecx, %eax
jae 0x40a4
movl -0xc0(%rbp), %eax
movl %eax, %ecx
leaq 0x6566(%rip), %rax      # 0xa5ed
movb (%rax,%rcx), %cl
movq -0xa0(%rbp), %rax
movq %rax, %rdx
addq $-0x1, %rdx
movq %rdx, -0xa0(%rbp)
movb %cl, -0x1(%rax)
jmp 0x4061
jmp 0x40a6
movl -0x34(%rbp), %edi
movq -0xa0(%rbp), %rcx
movl $0x2, %esi
movl $0x30, %edx
callq 0x49b0
movq %rax, -0xa0(%rbp)
movl $0x1, -0xc4(%rbp)
movl -0xc4(%rbp), %ecx
movl %ecx, %eax
addl $-0x1, %eax
movl %eax, -0xc4(%rbp)
xorl %eax, %eax
cmpl %ecx, %eax
jae 0x4113
movl -0xc4(%rbp), %eax
movl %eax, %ecx
leaq 0x615d(%rip), %rax      # 0xa253
movb (%rax,%rcx), %cl
movq -0xa0(%rbp), %rax
movq %rax, %rdx
addq $-0x1, %rdx
movq %rdx, -0xa0(%rbp)
movb %cl, -0x1(%rax)
jmp 0x40d0
jmp 0x4115
movl -0x30(%rbp), %edi
addl $0x1, %edi
movq -0xa0(%rbp), %rcx
movl $0x2, %esi
movl $0x30, %edx
callq 0x49b0
movq %rax, -0xa0(%rbp)
movq -0xa0(%rbp), %rdi
movq -0x98(%rbp), %rsi
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rdx
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rcx
callq 0x49f0
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x20(%rax)
addq $0xd0, %rsp
popq %rbp
retq
nop