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

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

int main(){

int N,T,A;
int X,temp,min=100000,ans=0;
scanf("%d",&N);
scanf("%d%d",&T,&A);
X = 1000*(T-A)/6;

int H;
for (int i = 0; i < N; i++)
{
  scanf("%d",&H);
  temp = abs(X-H);
  if (min>temp)
  {
    min = temp;
    ans = i;
  }
}

printf("%d",ans+1);

return 0;

}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%d%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB39:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	.LC0(%rip), %r15
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	movq	%r15, %rdi
	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	$40, %rsp
	.cfi_def_cfa_offset 96
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	8(%rsp), %rsi
	call	__isoc99_scanf@PLT
	leaq	16(%rsp), %rdx
	leaq	12(%rsp), %rsi
	xorl	%eax, %eax
	leaq	.LC1(%rip), %rdi
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	subl	16(%rsp), %eax
	imull	$1000, %eax, %eax
	movslq	%eax, %rbx
	sarl	$31, %eax
	imulq	$715827883, %rbx, %rbx
	shrq	$32, %rbx
	subl	%eax, %ebx
	movl	8(%rsp), %eax
	testl	%eax, %eax
	jle	.L6
	xorl	%r14d, %r14d
	xorl	%r13d, %r13d
	leaq	20(%rsp), %r12
	movl	$100000, %ebp
	.p2align 4,,10
	.p2align 3
.L4:
	xorl	%eax, %eax
	movq	%r12, %rsi
	movq	%r15, %rdi
	call	__isoc99_scanf@PLT
	movl	%ebx, %edx
	subl	20(%rsp), %edx
	movl	%edx, %eax
	negl	%eax
	cmovs	%edx, %eax
	cmpl	%ebp, %eax
	jge	.L3
	movl	%r14d, %r13d
	movl	%eax, %ebp
.L3:
	addl	$1, %r14d
	cmpl	%r14d, 8(%rsp)
	jg	.L4
.L2:
	xorl	%eax, %eax
	leal	1(%r13), %edx
	movq	%r15, %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L10
	addq	$40, %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
.L6:
	.cfi_restore_state
	xorl	%r13d, %r13d
	jmp	.L2
.L10:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE39:
	.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.
Optimized Assembly Code:

user
```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%d%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB39:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	.LC0(%rip), %r15
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	movq	%r15, %rdi
	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	$40, %rsp
	.cfi_def_cfa_offset 96
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	8(%rsp), %rsi
	call	__isoc99_scanf@PLT
	leaq	16(%rsp), %rdx
	leaq	12(%rsp), %rsi
	xorl	%eax, %eax
	leaq	.LC1(%rip), %rdi
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	subl	16(%rsp), %eax
	imull	$1000, %eax, %eax
	movslq	%eax, %rbx
	sarl	$31, %eax
	imulq	$715827883, %rbx, %rbx
	shrq	$32, %rbx
	subl	%eax, %ebx
	movl	8(%rsp), %eax
	testl	%eax, %eax
	jle	.L6
	xorl	%r14d, %r14d
	xorl	%r13d, %r13d
	leaq	20(%rsp), %r12
	movl	$100000, %ebp
	.p2align 4,,10
	.p2align 3
.L4:
	xorl	%eax, %eax
	movq	%r12, %rsi
	movq	%r15, %rdi
	call	__isoc99_scanf@PLT
	movl	%ebx, %edx
	subl	20(%rsp), %edx
	movl	%edx, %eax
	negl	%eax
	cmovs	%edx, %eax
	cmpl	%ebp, %eax
	jge	.L3
	movl	%r14d, %r13d
	movl	%eax, %ebp
.L3:
	addl	$1, %r14d
	cmpl	%r14d, 8(%rsp)
	jg	.L4
.L2:
	xorl	%eax, %eax
	leal	1(%r13), %edx
	movq	%r15, %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L10
	addq	$40, %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
.L6:
	.cfi_restore_state
	xorl	%r13d, %r13d
	jmp	.L2
.L10:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE39:
	.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
```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%d%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB39:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	.LC0(%rip), %r15
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	movq	%r15, %rdi
	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	$40, %rsp
	.cfi_def_cfa_offset 96
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	8(%rsp), %rsi
	call	__isoc99_scanf@PLT
	leaq	16(%rsp), %rdx
	leaq	12(%rsp), %rsi
	xorl	%eax, %eax
	leaq	.LC1(%rip), %rdi
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	subl	16(%rsp), %eax
	imull	$1000, %eax, %eax
	movslq	%eax, %rbx
	sarl	$31, %eax
	imulq	$715827883, %rbx, %rbx
	shrq	$32, %rbx
	subl	%eax, %ebx
	movl	8(%rsp), %eax
	testl	%eax, %eax
	jle	.L6
	xorl	%r14d, %r14d
	xorl	%r13d, %r13d
	leaq	20(%rsp), %r12
	movl	$100000, %ebp
	.p2align 4,,10
	.p2align 3
.L4:
	xorl	%eax, %eax
	movq	%r12, %rsi
	movq	%r15, %rdi
	call	__isoc99_scanf@PLT
	movl	%ebx, %edx
	subl	20(%rsp), %edx
	movl	%edx, %eax
	negl	%eax
	cmovs	%edx, %eax
	cmpl	%ebp, %eax
	jge	.L3
	movl	%r14d, %r13d
	movl	%eax, %ebp
.L3:
	addl	$1, %r14d
	cmpl	%r14d, 8(%rsp)
	jg	.L4
.L2:
	xorl	%eax, %eax
	leal	1(%r13), %edx
	movq	%r15, %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L10
	addq	$40, %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
.L6:
	.cfi_restore_state
	xorl	%r13d, %r13d
	jmp	.L2
.L10:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE39:
	.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:
```
```c
#include<stdio.h>
#include<stdlib.h>

int main(){

int N,T,A;
int X,temp,min=100000,ans=0;
scanf("%d",&N);
scanf("%d%d",&T,&A);
X = 1000*(T-A)/6;

int H;
for (int i = 0; i < N; i++)
{
  scanf("%d",&H);
  temp = abs(X-H);
  if (min>temp)
  {
    min = temp;
    ans = i;
  }
}

printf("%d",ans+1);

return 0;

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

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

int main(){

int N,T,A;
int X,temp,min=100000,ans=0;
scanf("%d",&N);
scanf("%d%d",&T,&A);
X = 1000*(T-A)/6;

int H;
for (int i = 0; i < N; i++)
{
  scanf("%d",&H);
  temp = abs(X-H);
  if (min>temp)
  {
    min = temp;
    ans = i;
  }
}

printf("%d",ans+1);

return 0;

}```

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.
Optimized Assembly Code:

2
12 5
1000 2000

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

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

int main(){

int N,T,A;
int X,temp,min=100000,ans=0;
scanf("%d",&N);
scanf("%d%d",&T,&A);
X = 1000*(T-A)/6;

int H;
for (int i = 0; i < N; i++)
{
  scanf("%d",&H);
  temp = abs(X-H);
  if (min>temp)
  {
    min = temp;
    ans = i;
  }
}

printf("%d",ans+1);

return 0;

}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%d%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB39:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	.LC0(%rip), %r15
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	movq	%r15, %rdi
	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	$40, %rsp
	.cfi_def_cfa_offset 96
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	8(%rsp), %rsi
	call	__isoc99_scanf@PLT
	leaq	16(%rsp), %rdx
	leaq	12(%rsp), %rsi
	xorl	%eax, %eax
	leaq	.LC1(%rip), %rdi
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	subl	16(%rsp), %eax
	imull	$1000, %eax, %eax
	movslq	%eax, %rbx
	sarl	$31, %eax
	imulq	$715827883, %rbx, %rbx
	shrq	$32, %rbx
	subl	%eax, %ebx
	movl	8(%rsp), %eax
	testl	%eax, %eax
	jle	.L6
	xorl	%r14d, %r14d
	xorl	%r13d, %r13d
	leaq	20(%rsp), %r12
	movl	$100000, %ebp
	.p2align 4,,10
	.p2align 3
.L4:
	xorl	%eax, %eax
	movq	%r12, %rsi
	movq	%r15, %rdi
	call	__isoc99_scanf@PLT
	movl	%ebx, %edx
	subl	20(%rsp), %edx
	movl	%edx, %eax
	negl	%eax
	cmovs	%edx, %eax
	cmpl	%ebp, %eax
	jge	.L3
	movl	%r14d, %r13d
	movl	%eax, %ebp
.L3:
	addl	$1, %r14d
	cmpl	%r14d, 8(%rsp)
	jg	.L4
.L2:
	xorl	%eax, %eax
	leal	1(%r13), %edx
	movq	%r15, %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L10
	addq	$40, %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
.L6:
	.cfi_restore_state
	xorl	%r13d, %r13d
	jmp	.L2
.L10:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE39:
	.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.
Optimized Assembly Code:

train
```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%d%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB39:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	.LC0(%rip), %r15
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	movq	%r15, %rdi
	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	$40, %rsp
	.cfi_def_cfa_offset 96
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	8(%rsp), %rsi
	call	__isoc99_scanf@PLT
	leaq	16(%rsp), %rdx
	leaq	12(%rsp), %rsi
	xorl	%eax, %eax
	leaq	.LC1(%rip), %rdi
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	subl	16(%rsp), %eax
	imull	$1000, %eax, %eax
	movslq	%eax, %rbx
	sarl	$31, %eax
	imulq	$715827883, %rbx, %rbx
	shrq	$32, %rbx
	subl	%eax, %ebx
	movl	8(%rsp), %eax
	testl	%eax, %eax
	jle	.L6
	xorl	%r14d, %r14d
	xorl	%r13d, %r13d
	leaq	20(%rsp), %r12
	movl	$100000, %ebp
	.p2align 4,,10
	.p2align 3
.L4:
	xorl	%eax, %eax
	movq	%r12, %rsi
	movq	%r15, %rdi
	call	__isoc99_scanf@PLT
	movl	%ebx, %edx
	subl	20(%rsp), %edx
	movl	%edx, %eax
	negl	%eax
	cmovs	%edx, %eax
	cmpl	%ebp, %eax
	jge	.L3
	movl	%r14d, %r13d
	movl	%eax, %ebp
.L3:
	addl	$1, %r14d
	cmpl	%r14d, 8(%rsp)
	jg	.L4
.L2:
	xorl	%eax, %eax
	leal	1(%r13), %edx
	movq	%r15, %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L10
	addq	$40, %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
.L6:
	.cfi_restore_state
	xorl	%r13d, %r13d
	jmp	.L2
.L10:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE39:
	.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:
```