Given the following C code and unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

typedef struct{
    char name[20];
    int exe_time;
    int fin_time;
}QueueData;

typedef struct _node
{
    QueueData data;
    struct _node *next;
}node;

typedef struct
{
    node *head, *tail;
}queue;

queue* init_queue()
{
    queue* qp = malloc(sizeof(queue));
    qp -> head = NULL;
    qp -> tail = NULL;
    return qp;
}

int empty(queue* q)
{
    return (q->head == NULL);
}

void enqueue(queue* q, QueueData d)
{
    node *np = malloc(sizeof(node));
    np->data = d;
    np->next = NULL;
    if(empty(q)){
        q -> head = np;
        q -> tail = np;
    }
    else{
        q -> tail -> next = np;
        q -> tail = np;
    }
}

QueueData dequeue(queue *q)
{
    if(empty(q)){
        printf("none\n");
        exit(1);
    }
    QueueData hold = q -> head -> data;
    node* temp = q -> head;
    q -> head = q -> head -> next;
    if(q->head == NULL) q->tail = NULL;
    free(temp);
    return hold;
}

int compare_find_time(const void* a, const void* b){
    QueueData *pa = (QueueData*) a;
    QueueData *pb = (QueueData*) b;

    return pa->fin_time - pb->fin_time;
}

int find_proc(char *s, QueueData *x, int total_proc){
    for(int i=0; i<total_proc; i++){
        if(strcmp(s,x[i].name)==0) return i;
    }
}

int main(){
    int proc_num, rr_time;
    queue *q = init_queue();
    scanf("%d %d", &proc_num, &rr_time);
    QueueData *proc = malloc(proc_num*sizeof(QueueData));
    for(int i=0; i<proc_num; i++){
        scanf("%s %d", proc[i].name, &proc[i].exe_time);
        enqueue(q, proc[i]);
    }

    
    int total_time = 0;
    while(!empty(q)){
        if((q->head->data).exe_time > rr_time){
            (q->head->data).exe_time -= rr_time;
            total_time += rr_time;
            //enqueue
            enqueue(q, q->head->data);
            //pop from queue
            node *temp_x = q->head;
            q -> head = q->head->next;
            free(temp_x);
        }
        else if
            ((q->head->data).exe_time>0&&(q->head->data).exe_time<=rr_time){
            total_time += (q->head->data).exe_time;
            (q->head->data).exe_time = 0;
            (q->head->data).fin_time = total_time;
            printf("%s %d\n", 
                    (q->head->data).name, total_time);
            /*int proc_no = find_proc((q->head->data).name, proc, proc_num);
            proc[proc_no].fin_time = total_time;*/
            //pop from queue
            node *temp_x = q->head;
            q -> head = q->head->next;
            free(temp_x);
        }
    }
    
    /*qsort(proc, proc_num, sizeof(*proc), compare_find_time);

    for(int i=0; i<proc_num; i++){
        printf("%s %d\n", proc[i].name, proc[i].fin_time);
    }*/

    
    /*while(!empty(q)){
        printf("%s %d\n", dequeue(q).name, dequeue(q).num);
    }*/
    //printf("\n");
}

```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	init_queue
	.type	init_queue, @function
init_queue:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movl	$16, %edi
	call	malloc@PLT
	movq	%rax, -8(%rbp)
	movq	-8(%rbp), %rax
	movq	$0, (%rax)
	movq	-8(%rbp), %rax
	movq	$0, 8(%rax)
	movq	-8(%rbp), %rax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	init_queue, .-init_queue
	.globl	empty
	.type	empty, @function
empty:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -8(%rbp)
	movq	-8(%rbp), %rax
	movq	(%rax), %rax
	testq	%rax, %rax
	sete	%al
	movzbl	%al, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	empty, .-empty
	.globl	enqueue
	.type	enqueue, @function
enqueue:
.LFB8:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%rbx
	subq	$40, %rsp
	.cfi_offset 3, -24
	movq	%rdi, -40(%rbp)
	movl	$40, %edi
	call	malloc@PLT
	movq	%rax, -24(%rbp)
	movq	-24(%rbp), %rax
	movq	16(%rbp), %rcx
	movq	24(%rbp), %rbx
	movq	%rcx, (%rax)
	movq	%rbx, 8(%rax)
	movq	32(%rbp), %rdx
	movq	%rdx, 16(%rax)
	movl	40(%rbp), %edx
	movl	%edx, 24(%rax)
	movq	-24(%rbp), %rax
	movq	$0, 32(%rax)
	movq	-40(%rbp), %rax
	movq	%rax, %rdi
	call	empty
	testl	%eax, %eax
	je	.L6
	movq	-40(%rbp), %rax
	movq	-24(%rbp), %rdx
	movq	%rdx, (%rax)
	movq	-40(%rbp), %rax
	movq	-24(%rbp), %rdx
	movq	%rdx, 8(%rax)
	jmp	.L8
.L6:
	movq	-40(%rbp), %rax
	movq	8(%rax), %rax
	movq	-24(%rbp), %rdx
	movq	%rdx, 32(%rax)
	movq	-40(%rbp), %rax
	movq	-24(%rbp), %rdx
	movq	%rdx, 8(%rax)
.L8:
	nop
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	enqueue, .-enqueue
	.section	.rodata
.LC0:
	.string	"none"
	.text
	.globl	dequeue
	.type	dequeue, @function
dequeue:
.LFB9:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%rbx
	subq	$88, %rsp
	.cfi_offset 3, -24
	movq	%rdi, -88(%rbp)
	movq	%rsi, -96(%rbp)
	movq	%fs:40, %rax
	movq	%rax, -24(%rbp)
	xorl	%eax, %eax
	movq	-96(%rbp), %rax
	movq	%rax, %rdi
	call	empty
	testl	%eax, %eax
	je	.L10
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$1, %edi
	call	exit@PLT
.L10:
	movq	-96(%rbp), %rax
	movq	(%rax), %rax
	movq	(%rax), %rcx
	movq	8(%rax), %rbx
	movq	%rcx, -64(%rbp)
	movq	%rbx, -56(%rbp)
	movq	16(%rax), %rdx
	movq	%rdx, -48(%rbp)
	movl	24(%rax), %eax
	movl	%eax, -40(%rbp)
	movq	-96(%rbp), %rax
	movq	(%rax), %rax
	movq	%rax, -72(%rbp)
	movq	-96(%rbp), %rax
	movq	(%rax), %rax
	movq	32(%rax), %rdx
	movq	-96(%rbp), %rax
	movq	%rdx, (%rax)
	movq	-96(%rbp), %rax
	movq	(%rax), %rax
	testq	%rax, %rax
	jne	.L11
	movq	-96(%rbp), %rax
	movq	$0, 8(%rax)
.L11:
	movq	-72(%rbp), %rax
	movq	%rax, %rdi
	call	free@PLT
	movq	-88(%rbp), %rax
	movq	-64(%rbp), %rcx
	movq	-56(%rbp), %rbx
	movq	%rcx, (%rax)
	movq	%rbx, 8(%rax)
	movq	-48(%rbp), %rdx
	movq	%rdx, 16(%rax)
	movl	-40(%rbp), %edx
	movl	%edx, 24(%rax)
	movq	-24(%rbp), %rax
	subq	%fs:40, %rax
	je	.L13
	call	__stack_chk_fail@PLT
.L13:
	movq	-88(%rbp), %rax
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	dequeue, .-dequeue
	.globl	compare_find_time
	.type	compare_find_time, @function
compare_find_time:
.LFB10:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -24(%rbp)
	movq	%rsi, -32(%rbp)
	movq	-24(%rbp), %rax
	movq	%rax, -16(%rbp)
	movq	-32(%rbp), %rax
	movq	%rax, -8(%rbp)
	movq	-16(%rbp), %rax
	movl	24(%rax), %edx
	movq	-8(%rbp), %rax
	movl	24(%rax), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.size	compare_find_time, .-compare_find_time
	.globl	find_proc
	.type	find_proc, @function
find_proc:
.LFB11:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$48, %rsp
	movq	%rdi, -24(%rbp)
	movq	%rsi, -32(%rbp)
	movl	%edx, -36(%rbp)
	movl	$0, -4(%rbp)
	jmp	.L17
.L20:
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	subq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rdx
	movq	-24(%rbp), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	strcmp@PLT
	testl	%eax, %eax
	jne	.L18
	movl	-4(%rbp), %eax
	jmp	.L16
.L18:
	addl	$1, -4(%rbp)
.L17:
	movl	-4(%rbp), %eax
	cmpl	-36(%rbp), %eax
	jl	.L20
.L16:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE11:
	.size	find_proc, .-find_proc
	.section	.rodata
.LC1:
	.string	"%d %d"
.LC2:
	.string	"%s %d"
.LC3:
	.string	"%s %d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB12:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%rbx
	subq	$72, %rsp
	.cfi_offset 3, -24
	movq	%fs:40, %rax
	movq	%rax, -24(%rbp)
	xorl	%eax, %eax
	movl	$0, %eax
	call	init_queue
	movq	%rax, -56(%rbp)
	leaq	-68(%rbp), %rdx
	leaq	-72(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-72(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	subq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdi
	call	malloc@PLT
	movq	%rax, -48(%rbp)
	movl	$0, -64(%rbp)
	jmp	.L22
.L23:
	movl	-64(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	subq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	movq	-48(%rbp), %rax
	addq	%rdx, %rax
	leaq	20(%rax), %rdx
	movl	-64(%rbp), %eax
	movslq	%eax, %rcx
	movq	%rcx, %rax
	salq	$3, %rax
	subq	%rcx, %rax
	salq	$2, %rax
	movq	%rax, %rcx
	movq	-48(%rbp), %rax
	addq	%rcx, %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-64(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	subq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	movq	-48(%rbp), %rax
	addq	%rdx, %rax
	movq	-56(%rbp), %rsi
	subq	$32, %rsp
	movq	%rsp, %rdx
	movq	(%rax), %rcx
	movq	8(%rax), %rbx
	movq	%rcx, (%rdx)
	movq	%rbx, 8(%rdx)
	movq	16(%rax), %rcx
	movq	%rcx, 16(%rdx)
	movl	24(%rax), %eax
	movl	%eax, 24(%rdx)
	movq	%rsi, %rdi
	call	enqueue
	addq	$32, %rsp
	addl	$1, -64(%rbp)
.L22:
	movl	-72(%rbp), %eax
	cmpl	%eax, -64(%rbp)
	jl	.L23
	movl	$0, -60(%rbp)
	jmp	.L24
.L26:
	movq	-56(%rbp), %rax
	movq	(%rax), %rax
	movl	20(%rax), %edx
	movl	-68(%rbp), %eax
	cmpl	%eax, %edx
	jle	.L25
	movq	-56(%rbp), %rax
	movq	(%rax), %rax
	movl	20(%rax), %edx
	movl	-68(%rbp), %ecx
	movq	-56(%rbp), %rax
	movq	(%rax), %rax
	subl	%ecx, %edx
	movl	%edx, 20(%rax)
	movl	-68(%rbp), %eax
	addl	%eax, -60(%rbp)
	movq	-56(%rbp), %rax
	movq	(%rax), %rax
	movq	-56(%rbp), %rsi
	subq	$32, %rsp
	movq	%rsp, %rdx
	movq	(%rax), %rcx
	movq	8(%rax), %rbx
	movq	%rcx, (%rdx)
	movq	%rbx, 8(%rdx)
	movq	16(%rax), %rcx
	movq	%rcx, 16(%rdx)
	movl	24(%rax), %eax
	movl	%eax, 24(%rdx)
	movq	%rsi, %rdi
	call	enqueue
	addq	$32, %rsp
	movq	-56(%rbp), %rax
	movq	(%rax), %rax
	movq	%rax, -32(%rbp)
	movq	-56(%rbp), %rax
	movq	(%rax), %rax
	movq	32(%rax), %rdx
	movq	-56(%rbp), %rax
	movq	%rdx, (%rax)
	movq	-32(%rbp), %rax
	movq	%rax, %rdi
	call	free@PLT
	jmp	.L24
.L25:
	movq	-56(%rbp), %rax
	movq	(%rax), %rax
	movl	20(%rax), %eax
	testl	%eax, %eax
	jle	.L24
	movq	-56(%rbp), %rax
	movq	(%rax), %rax
	movl	20(%rax), %edx
	movl	-68(%rbp), %eax
	cmpl	%eax, %edx
	jg	.L24
	movq	-56(%rbp), %rax
	movq	(%rax), %rax
	movl	20(%rax), %eax
	addl	%eax, -60(%rbp)
	movq	-56(%rbp), %rax
	movq	(%rax), %rax
	movl	$0, 20(%rax)
	movq	-56(%rbp), %rax
	movq	(%rax), %rax
	movl	-60(%rbp), %edx
	movl	%edx, 24(%rax)
	movq	-56(%rbp), %rax
	movq	(%rax), %rax
	movq	%rax, %rcx
	movl	-60(%rbp), %eax
	movl	%eax, %edx
	movq	%rcx, %rsi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movq	-56(%rbp), %rax
	movq	(%rax), %rax
	movq	%rax, -40(%rbp)
	movq	-56(%rbp), %rax
	movq	(%rax), %rax
	movq	32(%rax), %rdx
	movq	-56(%rbp), %rax
	movq	%rdx, (%rax)
	movq	-40(%rbp), %rax
	movq	%rax, %rdi
	call	free@PLT
.L24:
	movq	-56(%rbp), %rax
	movq	%rax, %rdi
	call	empty
	testl	%eax, %eax
	je	.L26
	movl	$0, %eax
	movq	-24(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L28
	call	__stack_chk_fail@PLT
.L28:
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE12:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
user
	.file	"temp.c"
	.text
	.p2align 4
	.globl	init_queue
	.type	init_queue, @function
init_queue:
.LFB51:
	.cfi_startproc
	endbr64
	subq	$8, %rsp
	.cfi_def_cfa_offset 16
	movl	$16, %edi
	call	malloc@PLT
	pxor	%xmm0, %xmm0
	movups	%xmm0, (%rax)
	addq	$8, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE51:
	.size	init_queue, .-init_queue
	.p2align 4
	.globl	empty
	.type	empty, @function
empty:
.LFB52:
	.cfi_startproc
	endbr64
	xorl	%eax, %eax
	cmpq	$0, (%rdi)
	sete	%al
	ret
	.cfi_endproc
.LFE52:
	.size	empty, .-empty
	.p2align 4
	.globl	enqueue
	.type	enqueue, @function
enqueue:
.LFB53:
	.cfi_startproc
	endbr64
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	movq	%rdi, %rbx
	movl	$40, %edi
	call	malloc@PLT
	movq	32(%rsp), %rdx
	movdqu	16(%rsp), %xmm0
	cmpq	$0, (%rbx)
	movq	$0, 32(%rax)
	movq	%rdx, 16(%rax)
	movl	40(%rsp), %edx
	movups	%xmm0, (%rax)
	movl	%edx, 24(%rax)
	je	.L9
	movq	8(%rbx), %rdx
	movq	%rax, 32(%rdx)
	movq	%rax, 8(%rbx)
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L9:
	.cfi_restore_state
	movq	%rax, (%rbx)
	movq	%rax, 8(%rbx)
	popq	%rbx
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE53:
	.size	enqueue, .-enqueue
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"none"
	.text
	.p2align 4
	.globl	dequeue
	.type	dequeue, @function
dequeue:
.LFB54:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	movq	%rdi, %r12
	subq	$48, %rsp
	.cfi_def_cfa_offset 64
	movq	(%rsi), %rdi
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	testq	%rdi, %rdi
	je	.L15
	movq	16(%rdi), %rax
	movdqu	(%rdi), %xmm0
	movq	%rax, 16(%rsp)
	movl	24(%rdi), %eax
	movaps	%xmm0, (%rsp)
	movl	%eax, 24(%rsp)
	movq	32(%rdi), %rax
	movq	%rax, (%rsi)
	testq	%rax, %rax
	je	.L16
.L12:
	call	free@PLT
	movq	16(%rsp), %rax
	movdqa	(%rsp), %xmm1
	movq	%rax, 16(%r12)
	movl	24(%rsp), %eax
	movups	%xmm1, (%r12)
	movl	%eax, 24(%r12)
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L17
	addq	$48, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 16
	movq	%r12, %rax
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L16:
	.cfi_restore_state
	movq	$0, 8(%rsi)
	jmp	.L12
.L15:
	leaq	.LC0(%rip), %rdi
	call	puts@PLT
	movl	$1, %edi
	call	exit@PLT
.L17:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE54:
	.size	dequeue, .-dequeue
	.p2align 4
	.globl	compare_find_time
	.type	compare_find_time, @function
compare_find_time:
.LFB55:
	.cfi_startproc
	endbr64
	movl	24(%rdi), %eax
	subl	24(%rsi), %eax
	ret
	.cfi_endproc
.LFE55:
	.size	compare_find_time, .-compare_find_time
	.p2align 4
	.globl	find_proc
	.type	find_proc, @function
find_proc:
.LFB56:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	subq	$8, %rsp
	.cfi_def_cfa_offset 48
	testl	%edx, %edx
	jle	.L19
	movq	%rdi, %rbp
	movl	%edx, %r13d
	movq	%rsi, %rbx
	xorl	%r12d, %r12d
	jmp	.L22
	.p2align 4,,10
	.p2align 3
.L25:
	addl	$1, %r12d
	addq	$28, %rbx
	cmpl	%r12d, %r13d
	je	.L19
.L22:
	movq	%rbx, %rsi
	movq	%rbp, %rdi
	call	strcmp@PLT
	testl	%eax, %eax
	jne	.L25
.L19:
	addq	$8, %rsp
	.cfi_def_cfa_offset 40
	movl	%r12d, %eax
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE56:
	.size	find_proc, .-find_proc
	.section	.rodata.str1.1
.LC1:
	.string	"%d %d"
.LC2:
	.string	"%s %d"
.LC3:
	.string	"%s %d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB57:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movl	$16, %edi
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$72, %rsp
	.cfi_def_cfa_offset 128
	movq	%fs:40, %rax
	movq	%rax, 56(%rsp)
	xorl	%eax, %eax
	call	malloc@PLT
	pxor	%xmm0, %xmm0
	leaq	12(%rsp), %rdx
	leaq	.LC1(%rip), %rdi
	movups	%xmm0, (%rax)
	movq	%rax, %r12
	leaq	8(%rsp), %rsi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	8(%rsp), %rax
	leaq	0(,%rax,8), %rdi
	movq	%rax, %rbp
	subq	%rax, %rdi
	salq	$2, %rdi
	call	malloc@PLT
	testl	%ebp, %ebp
	jle	.L33
	movq	%rax, %r15
	movq	%rax, %rbx
	leaq	.LC2(%rip), %r13
	xorl	%r14d, %r14d
.L38:
	leaq	20(%rbx), %rdx
	movq	%rbx, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	16(%rbx), %rax
	movdqu	(%rbx), %xmm1
	movl	$40, %edi
	movq	%rax, 32(%rsp)
	movl	24(%rbx), %eax
	movaps	%xmm1, 16(%rsp)
	movl	%eax, 40(%rsp)
	call	malloc@PLT
	movdqa	16(%rsp), %xmm2
	movq	%rax, %rbp
	movups	%xmm2, (%rax)
	movq	32(%rsp), %rax
	movq	$0, 32(%rbp)
	movq	%rax, 16(%rbp)
	movl	40(%rsp), %eax
	movl	%eax, 24(%rbp)
	movq	(%r12), %rax
	testq	%rax, %rax
	je	.L52
	movq	8(%r12), %rdx
	addl	$1, %r14d
	movq	%rbp, 8(%r12)
	movq	%rbp, 32(%rdx)
	cmpl	8(%rsp), %r14d
	jge	.L53
	movslq	%r14d, %rdx
	leaq	0(,%rdx,8), %rax
	subq	%rdx, %rax
	leaq	(%r15,%rax,4), %rbx
.L32:
	leaq	20(%rbx), %rdx
	movq	%rbx, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	16(%rbx), %rax
	movdqu	(%rbx), %xmm3
	movl	$40, %edi
	addl	$1, %r14d
	addq	$28, %rbx
	movq	%rax, 32(%rsp)
	movl	-4(%rbx), %eax
	movaps	%xmm3, 16(%rsp)
	movl	%eax, 40(%rsp)
	call	malloc@PLT
	movq	32(%rsp), %rdx
	movdqa	16(%rsp), %xmm4
	movq	$0, 32(%rax)
	movq	(%r12), %rbp
	movq	%rdx, 16(%rax)
	movl	40(%rsp), %edx
	movups	%xmm4, (%rax)
	movl	%edx, 24(%rax)
	movq	8(%r12), %rdx
	movq	%rax, 8(%r12)
	movq	%rax, 32(%rdx)
	cmpl	8(%rsp), %r14d
	jl	.L32
	testq	%rbp, %rbp
	je	.L33
	.p2align 4,,10
	.p2align 3
.L39:
	movl	20(%rbp), %eax
	movl	12(%rsp), %edx
	xorl	%r13d, %r13d
	leaq	.LC3(%rip), %rbx
.L37:
	cmpl	%edx, %eax
	jg	.L54
.L34:
	testl	%eax, %eax
	jle	.L37
	addl	%eax, %r13d
	movl	$0, 20(%rbp)
	movq	%rbp, %rdx
	movq	%rbx, %rsi
	movl	%r13d, 24(%rbp)
	movl	%r13d, %ecx
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	32(%rbp), %r14
	movq	%rbp, %rdi
	movq	%r14, %rbp
	movq	%r14, (%r12)
	call	free@PLT
	testq	%rbp, %rbp
	je	.L33
.L55:
	movl	20(%rbp), %eax
	movl	12(%rsp), %edx
	cmpl	%edx, %eax
	jle	.L34
.L54:
	subl	%edx, %eax
	movdqu	0(%rbp), %xmm5
	movl	$40, %edi
	addl	%edx, %r13d
	movl	%eax, 20(%rbp)
	movq	16(%rbp), %rax
	movaps	%xmm5, 16(%rsp)
	movq	%rax, 32(%rsp)
	movl	24(%rbp), %eax
	movl	%eax, 40(%rsp)
	call	malloc@PLT
	movq	32(%rsp), %rdx
	movdqa	16(%rsp), %xmm6
	movq	%rbp, %rdi
	movq	$0, 32(%rax)
	movq	%rax, %xmm7
	movq	%rdx, 16(%rax)
	movl	40(%rsp), %edx
	movups	%xmm6, (%rax)
	movl	%edx, 24(%rax)
	movq	8(%r12), %rdx
	movq	%rax, 32(%rdx)
	movq	32(%rbp), %r14
	movq	%r14, %xmm0
	movq	%r14, %rbp
	punpcklqdq	%xmm7, %xmm0
	movups	%xmm0, (%r12)
	call	free@PLT
	testq	%rbp, %rbp
	jne	.L55
.L33:
	movq	56(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L56
	addq	$72, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L52:
	.cfi_restore_state
	movq	%rbp, (%r12)
	addl	$1, %r14d
	movq	%rbp, 8(%r12)
	cmpl	%r14d, 8(%rsp)
	jle	.L39
	addq	$28, %rbx
	jmp	.L38
.L53:
	movq	%rax, %rbp
	jmp	.L39
.L56:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE57:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:

rule
	.file	"temp.c"
	.text
	.p2align 4
	.globl	init_queue
	.type	init_queue, @function
init_queue:
.LFB51:
	.cfi_startproc
	endbr64
	subq	$8, %rsp
	.cfi_def_cfa_offset 16
	movl	$16, %edi
	call	malloc@PLT
	pxor	%xmm0, %xmm0
	movups	%xmm0, (%rax)
	addq	$8, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE51:
	.size	init_queue, .-init_queue
	.p2align 4
	.globl	empty
	.type	empty, @function
empty:
.LFB52:
	.cfi_startproc
	endbr64
	xorl	%eax, %eax
	cmpq	$0, (%rdi)
	sete	%al
	ret
	.cfi_endproc
.LFE52:
	.size	empty, .-empty
	.p2align 4
	.globl	enqueue
	.type	enqueue, @function
enqueue:
.LFB53:
	.cfi_startproc
	endbr64
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	movq	%rdi, %rbx
	movl	$40, %edi
	call	malloc@PLT
	movq	32(%rsp), %rdx
	movdqu	16(%rsp), %xmm0
	cmpq	$0, (%rbx)
	movq	$0, 32(%rax)
	movq	%rdx, 16(%rax)
	movl	40(%rsp), %edx
	movups	%xmm0, (%rax)
	movl	%edx, 24(%rax)
	je	.L9
	movq	8(%rbx), %rdx
	movq	%rax, 32(%rdx)
	movq	%rax, 8(%rbx)
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L9:
	.cfi_restore_state
	movq	%rax, (%rbx)
	movq	%rax, 8(%rbx)
	popq	%rbx
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE53:
	.size	enqueue, .-enqueue
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"none"
	.text
	.p2align 4
	.globl	dequeue
	.type	dequeue, @function
dequeue:
.LFB54:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	movq	%rdi, %r12
	subq	$48, %rsp
	.cfi_def_cfa_offset 64
	movq	(%rsi), %rdi
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	testq	%rdi, %rdi
	je	.L15
	movq	16(%rdi), %rax
	movdqu	(%rdi), %xmm0
	movq	%rax, 16(%rsp)
	movl	24(%rdi), %eax
	movaps	%xmm0, (%rsp)
	movl	%eax, 24(%rsp)
	movq	32(%rdi), %rax
	movq	%rax, (%rsi)
	testq	%rax, %rax
	je	.L16
.L12:
	call	free@PLT
	movq	16(%rsp), %rax
	movdqa	(%rsp), %xmm1
	movq	%rax, 16(%r12)
	movl	24(%rsp), %eax
	movups	%xmm1, (%r12)
	movl	%eax, 24(%r12)
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L17
	addq	$48, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 16
	movq	%r12, %rax
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L16:
	.cfi_restore_state
	movq	$0, 8(%rsi)
	jmp	.L12
.L15:
	leaq	.LC0(%rip), %rdi
	call	puts@PLT
	movl	$1, %edi
	call	exit@PLT
.L17:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE54:
	.size	dequeue, .-dequeue
	.p2align 4
	.globl	compare_find_time
	.type	compare_find_time, @function
compare_find_time:
.LFB55:
	.cfi_startproc
	endbr64
	movl	24(%rdi), %eax
	subl	24(%rsi), %eax
	ret
	.cfi_endproc
.LFE55:
	.size	compare_find_time, .-compare_find_time
	.p2align 4
	.globl	find_proc
	.type	find_proc, @function
find_proc:
.LFB56:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	subq	$8, %rsp
	.cfi_def_cfa_offset 48
	testl	%edx, %edx
	jle	.L19
	movq	%rdi, %rbp
	movl	%edx, %r13d
	movq	%rsi, %rbx
	xorl	%r12d, %r12d
	jmp	.L22
	.p2align 4,,10
	.p2align 3
.L25:
	addl	$1, %r12d
	addq	$28, %rbx
	cmpl	%r12d, %r13d
	je	.L19
.L22:
	movq	%rbx, %rsi
	movq	%rbp, %rdi
	call	strcmp@PLT
	testl	%eax, %eax
	jne	.L25
.L19:
	addq	$8, %rsp
	.cfi_def_cfa_offset 40
	movl	%r12d, %eax
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE56:
	.size	find_proc, .-find_proc
	.section	.rodata.str1.1
.LC1:
	.string	"%d %d"
.LC2:
	.string	"%s %d"
.LC3:
	.string	"%s %d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB57:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movl	$16, %edi
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$72, %rsp
	.cfi_def_cfa_offset 128
	movq	%fs:40, %rax
	movq	%rax, 56(%rsp)
	xorl	%eax, %eax
	call	malloc@PLT
	pxor	%xmm0, %xmm0
	leaq	12(%rsp), %rdx
	leaq	.LC1(%rip), %rdi
	movups	%xmm0, (%rax)
	movq	%rax, %r12
	leaq	8(%rsp), %rsi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	8(%rsp), %rax
	leaq	0(,%rax,8), %rdi
	movq	%rax, %rbp
	subq	%rax, %rdi
	salq	$2, %rdi
	call	malloc@PLT
	testl	%ebp, %ebp
	jle	.L33
	movq	%rax, %r15
	movq	%rax, %rbx
	leaq	.LC2(%rip), %r13
	xorl	%r14d, %r14d
.L38:
	leaq	20(%rbx), %rdx
	movq	%rbx, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	16(%rbx), %rax
	movdqu	(%rbx), %xmm1
	movl	$40, %edi
	movq	%rax, 32(%rsp)
	movl	24(%rbx), %eax
	movaps	%xmm1, 16(%rsp)
	movl	%eax, 40(%rsp)
	call	malloc@PLT
	movdqa	16(%rsp), %xmm2
	movq	%rax, %rbp
	movups	%xmm2, (%rax)
	movq	32(%rsp), %rax
	movq	$0, 32(%rbp)
	movq	%rax, 16(%rbp)
	movl	40(%rsp), %eax
	movl	%eax, 24(%rbp)
	movq	(%r12), %rax
	testq	%rax, %rax
	je	.L52
	movq	8(%r12), %rdx
	addl	$1, %r14d
	movq	%rbp, 8(%r12)
	movq	%rbp, 32(%rdx)
	cmpl	8(%rsp), %r14d
	jge	.L53
	movslq	%r14d, %rdx
	leaq	0(,%rdx,8), %rax
	subq	%rdx, %rax
	leaq	(%r15,%rax,4), %rbx
.L32:
	leaq	20(%rbx), %rdx
	movq	%rbx, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	16(%rbx), %rax
	movdqu	(%rbx), %xmm3
	movl	$40, %edi
	addl	$1, %r14d
	addq	$28, %rbx
	movq	%rax, 32(%rsp)
	movl	-4(%rbx), %eax
	movaps	%xmm3, 16(%rsp)
	movl	%eax, 40(%rsp)
	call	malloc@PLT
	movq	32(%rsp), %rdx
	movdqa	16(%rsp), %xmm4
	movq	$0, 32(%rax)
	movq	(%r12), %rbp
	movq	%rdx, 16(%rax)
	movl	40(%rsp), %edx
	movups	%xmm4, (%rax)
	movl	%edx, 24(%rax)
	movq	8(%r12), %rdx
	movq	%rax, 8(%r12)
	movq	%rax, 32(%rdx)
	cmpl	8(%rsp), %r14d
	jl	.L32
	testq	%rbp, %rbp
	je	.L33
	.p2align 4,,10
	.p2align 3
.L39:
	movl	20(%rbp), %eax
	movl	12(%rsp), %edx
	xorl	%r13d, %r13d
	leaq	.LC3(%rip), %rbx
.L37:
	cmpl	%edx, %eax
	jg	.L54
.L34:
	testl	%eax, %eax
	jle	.L37
	addl	%eax, %r13d
	movl	$0, 20(%rbp)
	movq	%rbp, %rdx
	movq	%rbx, %rsi
	movl	%r13d, 24(%rbp)
	movl	%r13d, %ecx
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	32(%rbp), %r14
	movq	%rbp, %rdi
	movq	%r14, %rbp
	movq	%r14, (%r12)
	call	free@PLT
	testq	%rbp, %rbp
	je	.L33
.L55:
	movl	20(%rbp), %eax
	movl	12(%rsp), %edx
	cmpl	%edx, %eax
	jle	.L34
.L54:
	subl	%edx, %eax
	movdqu	0(%rbp), %xmm5
	movl	$40, %edi
	addl	%edx, %r13d
	movl	%eax, 20(%rbp)
	movq	16(%rbp), %rax
	movaps	%xmm5, 16(%rsp)
	movq	%rax, 32(%rsp)
	movl	24(%rbp), %eax
	movl	%eax, 40(%rsp)
	call	malloc@PLT
	movq	32(%rsp), %rdx
	movdqa	16(%rsp), %xmm6
	movq	%rbp, %rdi
	movq	$0, 32(%rax)
	movq	%rax, %xmm7
	movq	%rdx, 16(%rax)
	movl	40(%rsp), %edx
	movups	%xmm6, (%rax)
	movl	%edx, 24(%rax)
	movq	8(%r12), %rdx
	movq	%rax, 32(%rdx)
	movq	32(%rbp), %r14
	movq	%r14, %xmm0
	movq	%r14, %rbp
	punpcklqdq	%xmm7, %xmm0
	movups	%xmm0, (%r12)
	call	free@PLT
	testq	%rbp, %rbp
	jne	.L55
.L33:
	movq	56(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L56
	addq	$72, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L52:
	.cfi_restore_state
	movq	%rbp, (%r12)
	addl	$1, %r14d
	movq	%rbp, 8(%r12)
	cmpl	%r14d, 8(%rsp)
	jle	.L39
	addq	$28, %rbx
	jmp	.L38
.L53:
	movq	%rax, %rbp
	jmp	.L39
.L56:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE57:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

typedef struct{
    char name[20];
    int exe_time;
    int fin_time;
}QueueData;

typedef struct _node
{
    QueueData data;
    struct _node *next;
}node;

typedef struct
{
    node *head, *tail;
}queue;

queue* init_queue()
{
    queue* qp = malloc(sizeof(queue));
    qp -> head = NULL;
    qp -> tail = NULL;
    return qp;
}

int empty(queue* q)
{
    return (q->head == NULL);
}

void enqueue(queue* q, QueueData d)
{
    node *np = malloc(sizeof(node));
    np->data = d;
    np->next = NULL;
    if(empty(q)){
        q -> head = np;
        q -> tail = np;
    }
    else{
        q -> tail -> next = np;
        q -> tail = np;
    }
}

QueueData dequeue(queue *q)
{
    if(empty(q)){
        printf("none\n");
        exit(1);
    }
    QueueData hold = q -> head -> data;
    node* temp = q -> head;
    q -> head = q -> head -> next;
    if(q->head == NULL) q->tail = NULL;
    free(temp);
    return hold;
}

int compare_find_time(const void* a, const void* b){
    QueueData *pa = (QueueData*) a;
    QueueData *pb = (QueueData*) b;

    return pa->fin_time - pb->fin_time;
}

int find_proc(char *s, QueueData *x, int total_proc){
    for(int i=0; i<total_proc; i++){
        if(strcmp(s,x[i].name)==0) return i;
    }
}

int main(){
    int proc_num, rr_time;
    queue *q = init_queue();
    scanf("%d %d", &proc_num, &rr_time);
    QueueData *proc = malloc(proc_num*sizeof(QueueData));
    for(int i=0; i<proc_num; i++){
        scanf("%s %d", proc[i].name, &proc[i].exe_time);
        enqueue(q, proc[i]);
    }

    
    int total_time = 0;
    while(!empty(q)){
        if((q->head->data).exe_time > rr_time){
            (q->head->data).exe_time -= rr_time;
            total_time += rr_time;
            //enqueue
            enqueue(q, q->head->data);
            //pop from queue
            node *temp_x = q->head;
            q -> head = q->head->next;
            free(temp_x);
        }
        else if
            ((q->head->data).exe_time>0&&(q->head->data).exe_time<=rr_time){
            total_time += (q->head->data).exe_time;
            (q->head->data).exe_time = 0;
            (q->head->data).fin_time = total_time;
            printf("%s %d\n", 
                    (q->head->data).name, total_time);
            /*int proc_no = find_proc((q->head->data).name, proc, proc_num);
            proc[proc_no].fin_time = total_time;*/
            //pop from queue
            node *temp_x = q->head;
            q -> head = q->head->next;
            free(temp_x);
        }
    }
    
    /*qsort(proc, proc_num, sizeof(*proc), compare_find_time);

    for(int i=0; i<proc_num; i++){
        printf("%s %d\n", proc[i].name, proc[i].fin_time);
    }*/

    
    /*while(!empty(q)){
        printf("%s %d\n", dequeue(q).name, dequeue(q).num);
    }*/
    //printf("\n");
}


5 100
p1 150
p2 80
p3 200
p4 350
p5 14
 5 100
p1 150
2p 80
p3 200
p4 350
p5 14
 4 100
p1 150
2p 80
p3 200
p4 350
p5 14
 3 100
p1 150
2p 80
p3 200
p4 350
p5 14
 5 100
p1 150
p2 125
p3 200
p4 350
p5 20
 4 100
p1 150
p2 80
p3 200
p4 350
p5 14
 5 100
p1 150
2p 80
3p 200
p4 350
p5 14
 4 100
p1 150
2p 80
p2 200
p4 350
p5 14
 3 100
p1 150
p2 80
p3 200
p4 350
p5 14
 5 100
p1 150
p2 216
p3 200
p4 350
p5 20

p2 180
p5 394
p1 444
p3 544
p4 794
 2p 180
p5 394
p1 444
p3 544
p4 794
 2p 180
p1 430
p3 530
p4 780
 2p 180
p1 330
p3 430
 p5 420
p1 470
p2 495
p3 595
p4 845
 p2 180
p1 430
p3 530
p4 780
 2p 180
p5 394
p1 444
3p 544
p4 794
 2p 180
p1 430
p2 530
p4 780
 p2 180
p1 330
p3 430
 p5 420
p1 470
p3 670
p2 786
p4 936

Given the following C code and unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

typedef struct{
    char name[20];
    int exe_time;
    int fin_time;
}QueueData;

typedef struct _node
{
    QueueData data;
    struct _node *next;
}node;

typedef struct
{
    node *head, *tail;
}queue;

queue* init_queue()
{
    queue* qp = malloc(sizeof(queue));
    qp -> head = NULL;
    qp -> tail = NULL;
    return qp;
}

int empty(queue* q)
{
    return (q->head == NULL);
}

void enqueue(queue* q, QueueData d)
{
    node *np = malloc(sizeof(node));
    np->data = d;
    np->next = NULL;
    if(empty(q)){
        q -> head = np;
        q -> tail = np;
    }
    else{
        q -> tail -> next = np;
        q -> tail = np;
    }
}

QueueData dequeue(queue *q)
{
    if(empty(q)){
        printf("none\n");
        exit(1);
    }
    QueueData hold = q -> head -> data;
    node* temp = q -> head;
    q -> head = q -> head -> next;
    if(q->head == NULL) q->tail = NULL;
    free(temp);
    return hold;
}

int compare_find_time(const void* a, const void* b){
    QueueData *pa = (QueueData*) a;
    QueueData *pb = (QueueData*) b;

    return pa->fin_time - pb->fin_time;
}

int find_proc(char *s, QueueData *x, int total_proc){
    for(int i=0; i<total_proc; i++){
        if(strcmp(s,x[i].name)==0) return i;
    }
}

int main(){
    int proc_num, rr_time;
    queue *q = init_queue();
    scanf("%d %d", &proc_num, &rr_time);
    QueueData *proc = malloc(proc_num*sizeof(QueueData));
    for(int i=0; i<proc_num; i++){
        scanf("%s %d", proc[i].name, &proc[i].exe_time);
        enqueue(q, proc[i]);
    }

    
    int total_time = 0;
    while(!empty(q)){
        if((q->head->data).exe_time > rr_time){
            (q->head->data).exe_time -= rr_time;
            total_time += rr_time;
            //enqueue
            enqueue(q, q->head->data);
            //pop from queue
            node *temp_x = q->head;
            q -> head = q->head->next;
            free(temp_x);
        }
        else if
            ((q->head->data).exe_time>0&&(q->head->data).exe_time<=rr_time){
            total_time += (q->head->data).exe_time;
            (q->head->data).exe_time = 0;
            (q->head->data).fin_time = total_time;
            printf("%s %d\n", 
                    (q->head->data).name, total_time);
            /*int proc_no = find_proc((q->head->data).name, proc, proc_num);
            proc[proc_no].fin_time = total_time;*/
            //pop from queue
            node *temp_x = q->head;
            q -> head = q->head->next;
            free(temp_x);
        }
    }
    
    /*qsort(proc, proc_num, sizeof(*proc), compare_find_time);

    for(int i=0; i<proc_num; i++){
        printf("%s %d\n", proc[i].name, proc[i].fin_time);
    }*/

    
    /*while(!empty(q)){
        printf("%s %d\n", dequeue(q).name, dequeue(q).num);
    }*/
    //printf("\n");
}

```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	init_queue
	.type	init_queue, @function
init_queue:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movl	$16, %edi
	call	malloc@PLT
	movq	%rax, -8(%rbp)
	movq	-8(%rbp), %rax
	movq	$0, (%rax)
	movq	-8(%rbp), %rax
	movq	$0, 8(%rax)
	movq	-8(%rbp), %rax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	init_queue, .-init_queue
	.globl	empty
	.type	empty, @function
empty:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -8(%rbp)
	movq	-8(%rbp), %rax
	movq	(%rax), %rax
	testq	%rax, %rax
	sete	%al
	movzbl	%al, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	empty, .-empty
	.globl	enqueue
	.type	enqueue, @function
enqueue:
.LFB8:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%rbx
	subq	$40, %rsp
	.cfi_offset 3, -24
	movq	%rdi, -40(%rbp)
	movl	$40, %edi
	call	malloc@PLT
	movq	%rax, -24(%rbp)
	movq	-24(%rbp), %rax
	movq	16(%rbp), %rcx
	movq	24(%rbp), %rbx
	movq	%rcx, (%rax)
	movq	%rbx, 8(%rax)
	movq	32(%rbp), %rdx
	movq	%rdx, 16(%rax)
	movl	40(%rbp), %edx
	movl	%edx, 24(%rax)
	movq	-24(%rbp), %rax
	movq	$0, 32(%rax)
	movq	-40(%rbp), %rax
	movq	%rax, %rdi
	call	empty
	testl	%eax, %eax
	je	.L6
	movq	-40(%rbp), %rax
	movq	-24(%rbp), %rdx
	movq	%rdx, (%rax)
	movq	-40(%rbp), %rax
	movq	-24(%rbp), %rdx
	movq	%rdx, 8(%rax)
	jmp	.L8
.L6:
	movq	-40(%rbp), %rax
	movq	8(%rax), %rax
	movq	-24(%rbp), %rdx
	movq	%rdx, 32(%rax)
	movq	-40(%rbp), %rax
	movq	-24(%rbp), %rdx
	movq	%rdx, 8(%rax)
.L8:
	nop
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	enqueue, .-enqueue
	.section	.rodata
.LC0:
	.string	"none"
	.text
	.globl	dequeue
	.type	dequeue, @function
dequeue:
.LFB9:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%rbx
	subq	$88, %rsp
	.cfi_offset 3, -24
	movq	%rdi, -88(%rbp)
	movq	%rsi, -96(%rbp)
	movq	%fs:40, %rax
	movq	%rax, -24(%rbp)
	xorl	%eax, %eax
	movq	-96(%rbp), %rax
	movq	%rax, %rdi
	call	empty
	testl	%eax, %eax
	je	.L10
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$1, %edi
	call	exit@PLT
.L10:
	movq	-96(%rbp), %rax
	movq	(%rax), %rax
	movq	(%rax), %rcx
	movq	8(%rax), %rbx
	movq	%rcx, -64(%rbp)
	movq	%rbx, -56(%rbp)
	movq	16(%rax), %rdx
	movq	%rdx, -48(%rbp)
	movl	24(%rax), %eax
	movl	%eax, -40(%rbp)
	movq	-96(%rbp), %rax
	movq	(%rax), %rax
	movq	%rax, -72(%rbp)
	movq	-96(%rbp), %rax
	movq	(%rax), %rax
	movq	32(%rax), %rdx
	movq	-96(%rbp), %rax
	movq	%rdx, (%rax)
	movq	-96(%rbp), %rax
	movq	(%rax), %rax
	testq	%rax, %rax
	jne	.L11
	movq	-96(%rbp), %rax
	movq	$0, 8(%rax)
.L11:
	movq	-72(%rbp), %rax
	movq	%rax, %rdi
	call	free@PLT
	movq	-88(%rbp), %rax
	movq	-64(%rbp), %rcx
	movq	-56(%rbp), %rbx
	movq	%rcx, (%rax)
	movq	%rbx, 8(%rax)
	movq	-48(%rbp), %rdx
	movq	%rdx, 16(%rax)
	movl	-40(%rbp), %edx
	movl	%edx, 24(%rax)
	movq	-24(%rbp), %rax
	subq	%fs:40, %rax
	je	.L13
	call	__stack_chk_fail@PLT
.L13:
	movq	-88(%rbp), %rax
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	dequeue, .-dequeue
	.globl	compare_find_time
	.type	compare_find_time, @function
compare_find_time:
.LFB10:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -24(%rbp)
	movq	%rsi, -32(%rbp)
	movq	-24(%rbp), %rax
	movq	%rax, -16(%rbp)
	movq	-32(%rbp), %rax
	movq	%rax, -8(%rbp)
	movq	-16(%rbp), %rax
	movl	24(%rax), %edx
	movq	-8(%rbp), %rax
	movl	24(%rax), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.size	compare_find_time, .-compare_find_time
	.globl	find_proc
	.type	find_proc, @function
find_proc:
.LFB11:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$48, %rsp
	movq	%rdi, -24(%rbp)
	movq	%rsi, -32(%rbp)
	movl	%edx, -36(%rbp)
	movl	$0, -4(%rbp)
	jmp	.L17
.L20:
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	subq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rdx
	movq	-24(%rbp), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	strcmp@PLT
	testl	%eax, %eax
	jne	.L18
	movl	-4(%rbp), %eax
	jmp	.L16
.L18:
	addl	$1, -4(%rbp)
.L17:
	movl	-4(%rbp), %eax
	cmpl	-36(%rbp), %eax
	jl	.L20
.L16:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE11:
	.size	find_proc, .-find_proc
	.section	.rodata
.LC1:
	.string	"%d %d"
.LC2:
	.string	"%s %d"
.LC3:
	.string	"%s %d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB12:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%rbx
	subq	$72, %rsp
	.cfi_offset 3, -24
	movq	%fs:40, %rax
	movq	%rax, -24(%rbp)
	xorl	%eax, %eax
	movl	$0, %eax
	call	init_queue
	movq	%rax, -56(%rbp)
	leaq	-68(%rbp), %rdx
	leaq	-72(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-72(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	subq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdi
	call	malloc@PLT
	movq	%rax, -48(%rbp)
	movl	$0, -64(%rbp)
	jmp	.L22
.L23:
	movl	-64(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	subq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	movq	-48(%rbp), %rax
	addq	%rdx, %rax
	leaq	20(%rax), %rdx
	movl	-64(%rbp), %eax
	movslq	%eax, %rcx
	movq	%rcx, %rax
	salq	$3, %rax
	subq	%rcx, %rax
	salq	$2, %rax
	movq	%rax, %rcx
	movq	-48(%rbp), %rax
	addq	%rcx, %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-64(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	subq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	movq	-48(%rbp), %rax
	addq	%rdx, %rax
	movq	-56(%rbp), %rsi
	subq	$32, %rsp
	movq	%rsp, %rdx
	movq	(%rax), %rcx
	movq	8(%rax), %rbx
	movq	%rcx, (%rdx)
	movq	%rbx, 8(%rdx)
	movq	16(%rax), %rcx
	movq	%rcx, 16(%rdx)
	movl	24(%rax), %eax
	movl	%eax, 24(%rdx)
	movq	%rsi, %rdi
	call	enqueue
	addq	$32, %rsp
	addl	$1, -64(%rbp)
.L22:
	movl	-72(%rbp), %eax
	cmpl	%eax, -64(%rbp)
	jl	.L23
	movl	$0, -60(%rbp)
	jmp	.L24
.L26:
	movq	-56(%rbp), %rax
	movq	(%rax), %rax
	movl	20(%rax), %edx
	movl	-68(%rbp), %eax
	cmpl	%eax, %edx
	jle	.L25
	movq	-56(%rbp), %rax
	movq	(%rax), %rax
	movl	20(%rax), %edx
	movl	-68(%rbp), %ecx
	movq	-56(%rbp), %rax
	movq	(%rax), %rax
	subl	%ecx, %edx
	movl	%edx, 20(%rax)
	movl	-68(%rbp), %eax
	addl	%eax, -60(%rbp)
	movq	-56(%rbp), %rax
	movq	(%rax), %rax
	movq	-56(%rbp), %rsi
	subq	$32, %rsp
	movq	%rsp, %rdx
	movq	(%rax), %rcx
	movq	8(%rax), %rbx
	movq	%rcx, (%rdx)
	movq	%rbx, 8(%rdx)
	movq	16(%rax), %rcx
	movq	%rcx, 16(%rdx)
	movl	24(%rax), %eax
	movl	%eax, 24(%rdx)
	movq	%rsi, %rdi
	call	enqueue
	addq	$32, %rsp
	movq	-56(%rbp), %rax
	movq	(%rax), %rax
	movq	%rax, -32(%rbp)
	movq	-56(%rbp), %rax
	movq	(%rax), %rax
	movq	32(%rax), %rdx
	movq	-56(%rbp), %rax
	movq	%rdx, (%rax)
	movq	-32(%rbp), %rax
	movq	%rax, %rdi
	call	free@PLT
	jmp	.L24
.L25:
	movq	-56(%rbp), %rax
	movq	(%rax), %rax
	movl	20(%rax), %eax
	testl	%eax, %eax
	jle	.L24
	movq	-56(%rbp), %rax
	movq	(%rax), %rax
	movl	20(%rax), %edx
	movl	-68(%rbp), %eax
	cmpl	%eax, %edx
	jg	.L24
	movq	-56(%rbp), %rax
	movq	(%rax), %rax
	movl	20(%rax), %eax
	addl	%eax, -60(%rbp)
	movq	-56(%rbp), %rax
	movq	(%rax), %rax
	movl	$0, 20(%rax)
	movq	-56(%rbp), %rax
	movq	(%rax), %rax
	movl	-60(%rbp), %edx
	movl	%edx, 24(%rax)
	movq	-56(%rbp), %rax
	movq	(%rax), %rax
	movq	%rax, %rcx
	movl	-60(%rbp), %eax
	movl	%eax, %edx
	movq	%rcx, %rsi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movq	-56(%rbp), %rax
	movq	(%rax), %rax
	movq	%rax, -40(%rbp)
	movq	-56(%rbp), %rax
	movq	(%rax), %rax
	movq	32(%rax), %rdx
	movq	-56(%rbp), %rax
	movq	%rdx, (%rax)
	movq	-40(%rbp), %rax
	movq	%rax, %rdi
	call	free@PLT
.L24:
	movq	-56(%rbp), %rax
	movq	%rax, %rdi
	call	empty
	testl	%eax, %eax
	je	.L26
	movl	$0, %eax
	movq	-24(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L28
	call	__stack_chk_fail@PLT
.L28:
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE12:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
train
	.file	"temp.c"
	.text
	.globl	init_queue
	.type	init_queue, @function
init_queue:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movl	$16, %edi
	call	malloc@PLT
	movq	%rax, -8(%rbp)
	movq	-8(%rbp), %rax
	movq	$0, (%rax)
	movq	-8(%rbp), %rax
	movq	$0, 8(%rax)
	movq	-8(%rbp), %rax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	init_queue, .-init_queue
	.globl	empty
	.type	empty, @function
empty:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -8(%rbp)
	movq	-8(%rbp), %rax
	movq	(%rax), %rax
	testq	%rax, %rax
	sete	%al
	movzbl	%al, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	empty, .-empty
	.globl	enqueue
	.type	enqueue, @function
enqueue:
.LFB8:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%rbx
	subq	$40, %rsp
	.cfi_offset 3, -24
	movq	%rdi, -40(%rbp)
	movl	$40, %edi
	call	malloc@PLT
	movq	%rax, -24(%rbp)
	movq	-24(%rbp), %rax
	movq	16(%rbp), %rcx
	movq	24(%rbp), %rbx
	movq	%rcx, (%rax)
	movq	%rbx, 8(%rax)
	movq	32(%rbp), %rdx
	movq	%rdx, 16(%rax)
	movl	40(%rbp), %edx
	movl	%edx, 24(%rax)
	movq	-24(%rbp), %rax
	movq	$0, 32(%rax)
	movq	-40(%rbp), %rax
	movq	%rax, %rdi
	call	empty
	testl	%eax, %eax
	je	.L6
	movq	-40(%rbp), %rax
	movq	-24(%rbp), %rdx
	movq	%rdx, (%rax)
	movq	-40(%rbp), %rax
	movq	-24(%rbp), %rdx
	movq	%rdx, 8(%rax)
	jmp	.L8
.L6:
	movq	-40(%rbp), %rax
	movq	8(%rax), %rax
	movq	-24(%rbp), %rdx
	movq	%rdx, 32(%rax)
	movq	-40(%rbp), %rax
	movq	-24(%rbp), %rdx
	movq	%rdx, 8(%rax)
.L8:
	nop
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	enqueue, .-enqueue
	.section	.rodata
.LC0:
	.string	"none"
	.text
	.globl	dequeue
	.type	dequeue, @function
dequeue:
.LFB9:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%rbx
	subq	$88, %rsp
	.cfi_offset 3, -24
	movq	%rdi, -88(%rbp)
	movq	%rsi, -96(%rbp)
	movq	%fs:40, %rax
	movq	%rax, -24(%rbp)
	xorl	%eax, %eax
	movq	-96(%rbp), %rax
	movq	%rax, %rdi
	call	empty
	testl	%eax, %eax
	je	.L10
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$1, %edi
	call	exit@PLT
.L10:
	movq	-96(%rbp), %rax
	movq	(%rax), %rax
	movq	(%rax), %rcx
	movq	8(%rax), %rbx
	movq	%rcx, -64(%rbp)
	movq	%rbx, -56(%rbp)
	movq	16(%rax), %rdx
	movq	%rdx, -48(%rbp)
	movl	24(%rax), %eax
	movl	%eax, -40(%rbp)
	movq	-96(%rbp), %rax
	movq	(%rax), %rax
	movq	%rax, -72(%rbp)
	movq	-96(%rbp), %rax
	movq	(%rax), %rax
	movq	32(%rax), %rdx
	movq	-96(%rbp), %rax
	movq	%rdx, (%rax)
	movq	-96(%rbp), %rax
	movq	(%rax), %rax
	testq	%rax, %rax
	jne	.L11
	movq	-96(%rbp), %rax
	movq	$0, 8(%rax)
.L11:
	movq	-72(%rbp), %rax
	movq	%rax, %rdi
	call	free@PLT
	movq	-88(%rbp), %rax
	movq	-64(%rbp), %rcx
	movq	-56(%rbp), %rbx
	movq	%rcx, (%rax)
	movq	%rbx, 8(%rax)
	movq	-48(%rbp), %rdx
	movq	%rdx, 16(%rax)
	movl	-40(%rbp), %edx
	movl	%edx, 24(%rax)
	movq	-24(%rbp), %rax
	subq	%fs:40, %rax
	je	.L13
	call	__stack_chk_fail@PLT
.L13:
	movq	-88(%rbp), %rax
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	dequeue, .-dequeue
	.globl	compare_find_time
	.type	compare_find_time, @function
compare_find_time:
.LFB10:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -24(%rbp)
	movq	%rsi, -32(%rbp)
	movq	-24(%rbp), %rax
	movq	%rax, -16(%rbp)
	movq	-32(%rbp), %rax
	movq	%rax, -8(%rbp)
	movq	-16(%rbp), %rax
	movl	24(%rax), %edx
	movq	-8(%rbp), %rax
	movl	24(%rax), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.size	compare_find_time, .-compare_find_time
	.globl	find_proc
	.type	find_proc, @function
find_proc:
.LFB11:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$48, %rsp
	movq	%rdi, -24(%rbp)
	movq	%rsi, -32(%rbp)
	movl	%edx, -36(%rbp)
	movl	$0, -4(%rbp)
	jmp	.L17
.L20:
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	subq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rdx
	movq	-24(%rbp), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	strcmp@PLT
	testl	%eax, %eax
	jne	.L18
	movl	-4(%rbp), %eax
	jmp	.L16
.L18:
	addl	$1, -4(%rbp)
.L17:
	movl	-4(%rbp), %eax
	cmpl	-36(%rbp), %eax
	jl	.L20
.L16:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE11:
	.size	find_proc, .-find_proc
	.section	.rodata
.LC1:
	.string	"%d %d"
.LC2:
	.string	"%s %d"
.LC3:
	.string	"%s %d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB12:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%rbx
	subq	$72, %rsp
	.cfi_offset 3, -24
	movq	%fs:40, %rax
	movq	%rax, -24(%rbp)
	xorl	%eax, %eax
	movl	$0, %eax
	call	init_queue
	movq	%rax, -56(%rbp)
	leaq	-68(%rbp), %rdx
	leaq	-72(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-72(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	subq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdi
	call	malloc@PLT
	movq	%rax, -48(%rbp)
	movl	$0, -64(%rbp)
	jmp	.L22
.L23:
	movl	-64(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	subq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	movq	-48(%rbp), %rax
	addq	%rdx, %rax
	leaq	20(%rax), %rdx
	movl	-64(%rbp), %eax
	movslq	%eax, %rcx
	movq	%rcx, %rax
	salq	$3, %rax
	subq	%rcx, %rax
	salq	$2, %rax
	movq	%rax, %rcx
	movq	-48(%rbp), %rax
	addq	%rcx, %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-64(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	subq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	movq	-48(%rbp), %rax
	addq	%rdx, %rax
	movq	-56(%rbp), %rsi
	subq	$32, %rsp
	movq	%rsp, %rdx
	movq	(%rax), %rcx
	movq	8(%rax), %rbx
	movq	%rcx, (%rdx)
	movq	%rbx, 8(%rdx)
	movq	16(%rax), %rcx
	movq	%rcx, 16(%rdx)
	movl	24(%rax), %eax
	movl	%eax, 24(%rdx)
	movq	%rsi, %rdi
	call	enqueue
	addq	$32, %rsp
	addl	$1, -64(%rbp)
.L22:
	movl	-72(%rbp), %eax
	cmpl	%eax, -64(%rbp)
	jl	.L23
	movl	$0, -60(%rbp)
	jmp	.L24
.L26:
	movq	-56(%rbp), %rax
	movq	(%rax), %rax
	movl	20(%rax), %edx
	movl	-68(%rbp), %eax
	cmpl	%eax, %edx
	jle	.L25
	movq	-56(%rbp), %rax
	movq	(%rax), %rax
	movl	20(%rax), %edx
	movl	-68(%rbp), %ecx
	movq	-56(%rbp), %rax
	movq	(%rax), %rax
	subl	%ecx, %edx
	movl	%edx, 20(%rax)
	movl	-68(%rbp), %eax
	addl	%eax, -60(%rbp)
	movq	-56(%rbp), %rax
	movq	(%rax), %rax
	movq	-56(%rbp), %rsi
	subq	$32, %rsp
	movq	%rsp, %rdx
	movq	(%rax), %rcx
	movq	8(%rax), %rbx
	movq	%rcx, (%rdx)
	movq	%rbx, 8(%rdx)
	movq	16(%rax), %rcx
	movq	%rcx, 16(%rdx)
	movl	24(%rax), %eax
	movl	%eax, 24(%rdx)
	movq	%rsi, %rdi
	call	enqueue
	addq	$32, %rsp
	movq	-56(%rbp), %rax
	movq	(%rax), %rax
	movq	%rax, -32(%rbp)
	movq	-56(%rbp), %rax
	movq	(%rax), %rax
	movq	32(%rax), %rdx
	movq	-56(%rbp), %rax
	movq	%rdx, (%rax)
	movq	-32(%rbp), %rax
	movq	%rax, %rdi
	call	free@PLT
	jmp	.L24
.L25:
	movq	-56(%rbp), %rax
	movq	(%rax), %rax
	movl	20(%rax), %eax
	testl	%eax, %eax
	jle	.L24
	movq	-56(%rbp), %rax
	movq	(%rax), %rax
	movl	20(%rax), %edx
	movl	-68(%rbp), %eax
	cmpl	%eax, %edx
	jg	.L24
	movq	-56(%rbp), %rax
	movq	(%rax), %rax
	movl	20(%rax), %eax
	addl	%eax, -60(%rbp)
	movq	-56(%rbp), %rax
	movq	(%rax), %rax
	movl	$0, 20(%rax)
	movq	-56(%rbp), %rax
	movq	(%rax), %rax
	movl	-60(%rbp), %edx
	movl	%edx, 24(%rax)
	movq	-56(%rbp), %rax
	movq	(%rax), %rax
	movq	%rax, %rcx
	movl	-60(%rbp), %eax
	movl	%eax, %edx
	movq	%rcx, %rsi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movq	-56(%rbp), %rax
	movq	(%rax), %rax
	movq	%rax, -40(%rbp)
	movq	-56(%rbp), %rax
	movq	(%rax), %rax
	movq	32(%rax), %rdx
	movq	-56(%rbp), %rax
	movq	%rdx, (%rax)
	movq	-40(%rbp), %rax
	movq	%rax, %rdi
	call	free@PLT
.L24:
	movq	-56(%rbp), %rax
	movq	%rax, %rdi
	call	empty
	testl	%eax, %eax
	je	.L26
	movl	$0, %eax
	movq	-24(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L28
	call	__stack_chk_fail@PLT
.L28:
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE12:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
