// File: /workspace/github_c_makefile_star2_O0/TimeToogo[P]ff-proxy/client/c/client.c
// Function: ff_client_create_payload_options
uint8_t ff_client_create_payload_options(struct ff_request *request, struct ff_client_config *config)
{
    uint64_t now = (uint64_t)time(NULL);
    now = htonll(now);

    struct ff_request_payload_node *payload = NULL;
    struct ff_request_option_node **options = malloc(sizeof(struct ff_request_option_node *) * FF_REQUEST_MAX_OPTIONS);
    uint8_t option_i = 0;
    uint16_t length = 0;

    if (config->https)
    {
        options[option_i] = ff_request_option_node_alloc();
        options[option_i]->type = FF_REQUEST_OPTION_TYPE_HTTPS;
        options[option_i]->length = 1;
        options[option_i]->value = malloc(1);
        options[option_i]->value[0] = 1;
        length += sizeof(struct __raw_ff_request_option_header) + options[option_i]->length;
        option_i++;
    }

    options[option_i] = ff_request_option_node_alloc();
    options[option_i]->type = FF_REQUEST_OPTION_TYPE_TIMESTAMP;
    options[option_i]->length = 8;
    options[option_i]->value = malloc(8);
    memcpy(options[option_i]->value, &now, 8);
    length += sizeof(struct __raw_ff_request_option_header) + options[option_i]->length;
    option_i++;

    options[option_i] = ff_request_option_node_alloc();
    options[option_i]->type = FF_REQUEST_OPTION_TYPE_EOL;
    length += sizeof(struct __raw_ff_request_option_header) + options[option_i]->length;
    option_i++;

    payload = ff_request_payload_node_alloc();
    payload->value = malloc(length);
    payload->length = length;

    ff_client_write_options(payload->value, options, option_i);

    ff_client_request_add_payload(request, payload);

    for (uint8_t i = 0; i < option_i; i++)
    {
        ff_request_option_node_free(options[i]);
    }

    FREE(options);

    return option_i;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
xorl %eax, %eax
movl %eax, %edi
callq 0x21a0
movq %rax, -0x18(%rbp)
movl $0x1, %edi
callq 0x2160
movl %eax, %ecx
movl $0x1, %eax
cmpl %ecx, %eax
jne 0x266c
movq -0x18(%rbp), %rax
movq %rax, -0x38(%rbp)
jmp 0x26a9
movabsq $0xffffffff, %rax       # imm = 0xFFFFFFFF
andq -0x18(%rbp), %rax
movl %eax, %edi
callq 0x2160
movl %eax, %eax
shlq $0x20, %rax
movq %rax, -0x40(%rbp)
movq -0x18(%rbp), %rax
shrq $0x20, %rax
movl %eax, %edi
callq 0x2160
movl %eax, %ecx
movq -0x40(%rbp), %rax
movl %ecx, %ecx
orq %rcx, %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
movq %rax, -0x18(%rbp)
movq $0x0, -0x20(%rbp)
movl $0xa0, %edi
callq 0x2250
movq %rax, -0x28(%rbp)
movb $0x0, -0x29(%rbp)
movw $0x0, -0x2c(%rbp)
movq -0x10(%rbp), %rax
testb $0x1, 0x10(%rax)
je 0x2770
callq 0x4620
movq %rax, %rdx
movq -0x28(%rbp), %rax
movzbl -0x29(%rbp), %ecx
movq %rdx, (%rax,%rcx,8)
movq -0x28(%rbp), %rax
movzbl -0x29(%rbp), %ecx
movq (%rax,%rcx,8), %rax
movl $0x4, (%rax)
movq -0x28(%rbp), %rax
movzbl -0x29(%rbp), %ecx
movq (%rax,%rcx,8), %rax
movw $0x1, 0x4(%rax)
movl $0x1, %edi
callq 0x2250
movq %rax, %rcx
movq -0x28(%rbp), %rax
movzbl -0x29(%rbp), %edx
movq (%rax,%rdx,8), %rax
movq %rcx, 0x8(%rax)
movq -0x28(%rbp), %rax
movzbl -0x29(%rbp), %ecx
movq (%rax,%rcx,8), %rax
movq 0x8(%rax), %rax
movb $0x1, (%rax)
movq -0x28(%rbp), %rax
movzbl -0x29(%rbp), %ecx
movq (%rax,%rcx,8), %rax
movzwl 0x4(%rax), %eax
movl %eax, %ecx
addq $0x3, %rcx
movzwl -0x2c(%rbp), %eax
addq %rcx, %rax
movw %ax, -0x2c(%rbp)
movb -0x29(%rbp), %al
addb $0x1, %al
movb %al, -0x29(%rbp)
callq 0x4620
movq %rax, %rdx
movq -0x28(%rbp), %rax
movzbl -0x29(%rbp), %ecx
movq %rdx, (%rax,%rcx,8)
movq -0x28(%rbp), %rax
movzbl -0x29(%rbp), %ecx
movq (%rax,%rcx,8), %rax
movl $0x8, (%rax)
movq -0x28(%rbp), %rax
movzbl -0x29(%rbp), %ecx
movq (%rax,%rcx,8), %rax
movw $0x8, 0x4(%rax)
movl $0x8, %edi
callq 0x2250
movq %rax, %rcx
movq -0x28(%rbp), %rax
movzbl -0x29(%rbp), %edx
movq (%rax,%rdx,8), %rax
movq %rcx, 0x8(%rax)
movq -0x28(%rbp), %rax
movzbl -0x29(%rbp), %ecx
movq (%rax,%rcx,8), %rax
movq 0x8(%rax), %rax
movq -0x18(%rbp), %rcx
movq %rcx, (%rax)
movq -0x28(%rbp), %rax
movzbl -0x29(%rbp), %ecx
movq (%rax,%rcx,8), %rax
movzwl 0x4(%rax), %eax
movl %eax, %ecx
addq $0x3, %rcx
movzwl -0x2c(%rbp), %eax
addq %rcx, %rax
movw %ax, -0x2c(%rbp)
movb -0x29(%rbp), %al
addb $0x1, %al
movb %al, -0x29(%rbp)
callq 0x4620
movq %rax, %rdx
movq -0x28(%rbp), %rax
movzbl -0x29(%rbp), %ecx
movq %rdx, (%rax,%rcx,8)
movq -0x28(%rbp), %rax
movzbl -0x29(%rbp), %ecx
movq (%rax,%rcx,8), %rax
movl $0x0, (%rax)
movq -0x28(%rbp), %rax
movzbl -0x29(%rbp), %ecx
movq (%rax,%rcx,8), %rax
movzwl 0x4(%rax), %eax
movl %eax, %ecx
addq $0x3, %rcx
movzwl -0x2c(%rbp), %eax
addq %rcx, %rax
movw %ax, -0x2c(%rbp)
movb -0x29(%rbp), %al
addb $0x1, %al
movb %al, -0x29(%rbp)
callq 0x4700
movq %rax, -0x20(%rbp)
movzwl -0x2c(%rbp), %eax
movl %eax, %edi
callq 0x2250
movq %rax, %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x8(%rax)
movw -0x2c(%rbp), %cx
movq -0x20(%rbp), %rax
movw %cx, 0x2(%rax)
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x28(%rbp), %rsi
movzbl -0x29(%rbp), %edx
callq 0x3070
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x3150
movb $0x0, -0x2d(%rbp)
movzbl -0x2d(%rbp), %eax
movzbl -0x29(%rbp), %ecx
cmpl %ecx, %eax
jge 0x28cc
movq -0x28(%rbp), %rax
movzbl -0x2d(%rbp), %ecx
movq (%rax,%rcx,8), %rdi
callq 0x46b0
movb -0x2d(%rbp), %al
addb $0x1, %al
movb %al, -0x2d(%rbp)
jmp 0x28a5
jmp 0x28ce
movq -0x28(%rbp), %rdi
callq 0x2200
movq $0x0, -0x28(%rbp)
movb -0x29(%rbp), %al
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax,%rax)