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 <math.h>
#include <string.h>
 
 
void swap (int *x, int *y) {
  int temp;    
 
  temp = *x;
  *x = *y;
  *y = temp;
}
 
int gcd(int a,int b){
  if(a<b){
    swap(&a,&b);
  }
 
  if(b==0){
    return a;
  }
 
  int r=a%b;
  while(r!=0){
    a = b;
    b = r;
    r = (a%b);
  }
 
  return b;
}
 
/* クイックソート */
int dn(const void*a,const void*b){return*(int*)b-*(int*)a;}
 
 
int modpow(int a,int n,int mod){
  int ans=1;
  while(n>0){
    if(n & 1){
      ans=ans*a%mod;
    }
    a=a*a%mod;
    n/=2;
  }
  return ans;
}
 
int max(int a,int b){
  if(a<b){
    return b;
  }
  else{
    return a;
  }
}
 
int min(int a,int b){
  if(a<b){
    return a;
  }
  else{
    return b;
  }
}
 
void chmax(int *a,int b){
  if(*a < b){
    *a = b;
  }
 
  return;
}
 
void chmin(int *a,int b){
  if(*a > b){
    *a =b;
  }
 
  return;
}
 

int main(void){
  long int h;
  scanf("%ld",&h);
  long int max=0;
  long int d;
  for(int i=0;i<40;i++){
    d=pow(2,i);
    if(h/d>=1){
      max=i;
    }else{
      break;
    }
  }
  long int sum=0;
  for(int i=0;i<max+1;i++){
    sum+=pow(2,i);
  }
  printf("%ld\n",sum);
  return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	swap
	.type	swap, @function
swap:
.LFB6:
	.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
	movl	(%rax), %eax
	movl	%eax, -4(%rbp)
	movq	-32(%rbp), %rax
	movl	(%rax), %edx
	movq	-24(%rbp), %rax
	movl	%edx, (%rax)
	movq	-32(%rbp), %rax
	movl	-4(%rbp), %edx
	movl	%edx, (%rax)
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	swap, .-swap
	.globl	gcd
	.type	gcd, @function
gcd:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$24, %rsp
	movl	%edi, -20(%rbp)
	movl	%esi, -24(%rbp)
	movl	-20(%rbp), %edx
	movl	-24(%rbp), %eax
	cmpl	%eax, %edx
	jge	.L3
	leaq	-24(%rbp), %rdx
	leaq	-20(%rbp), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	swap
.L3:
	movl	-24(%rbp), %eax
	testl	%eax, %eax
	jne	.L4
	movl	-20(%rbp), %eax
	jmp	.L5
.L4:
	movl	-20(%rbp), %eax
	movl	-24(%rbp), %ecx
	cltd
	idivl	%ecx
	movl	%edx, -4(%rbp)
	jmp	.L6
.L7:
	movl	-24(%rbp), %eax
	movl	%eax, -20(%rbp)
	movl	-4(%rbp), %eax
	movl	%eax, -24(%rbp)
	movl	-20(%rbp), %eax
	movl	-24(%rbp), %ecx
	cltd
	idivl	%ecx
	movl	%edx, -4(%rbp)
.L6:
	cmpl	$0, -4(%rbp)
	jne	.L7
	movl	-24(%rbp), %eax
.L5:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	gcd, .-gcd
	.globl	dn
	.type	dn, @function
dn:
.LFB8:
	.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	%rsi, -16(%rbp)
	movq	-16(%rbp), %rax
	movl	(%rax), %edx
	movq	-8(%rbp), %rax
	movl	(%rax), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	dn, .-dn
	.globl	modpow
	.type	modpow, @function
modpow:
.LFB9:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -20(%rbp)
	movl	%esi, -24(%rbp)
	movl	%edx, -28(%rbp)
	movl	$1, -4(%rbp)
	jmp	.L11
.L13:
	movl	-24(%rbp), %eax
	andl	$1, %eax
	testl	%eax, %eax
	je	.L12
	movl	-4(%rbp), %eax
	imull	-20(%rbp), %eax
	cltd
	idivl	-28(%rbp)
	movl	%edx, -4(%rbp)
.L12:
	movl	-20(%rbp), %eax
	imull	%eax, %eax
	cltd
	idivl	-28(%rbp)
	movl	%edx, -20(%rbp)
	movl	-24(%rbp), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, -24(%rbp)
.L11:
	cmpl	$0, -24(%rbp)
	jg	.L13
	movl	-4(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	modpow, .-modpow
	.globl	max
	.type	max, @function
max:
.LFB10:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	-4(%rbp), %eax
	cmpl	-8(%rbp), %eax
	jge	.L16
	movl	-8(%rbp), %eax
	jmp	.L17
.L16:
	movl	-4(%rbp), %eax
.L17:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.size	max, .-max
	.globl	min
	.type	min, @function
min:
.LFB11:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	-4(%rbp), %eax
	cmpl	-8(%rbp), %eax
	jge	.L19
	movl	-4(%rbp), %eax
	jmp	.L20
.L19:
	movl	-8(%rbp), %eax
.L20:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE11:
	.size	min, .-min
	.globl	chmax
	.type	chmax, @function
chmax:
.LFB12:
	.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)
	movl	%esi, -12(%rbp)
	movq	-8(%rbp), %rax
	movl	(%rax), %eax
	cmpl	%eax, -12(%rbp)
	jle	.L24
	movq	-8(%rbp), %rax
	movl	-12(%rbp), %edx
	movl	%edx, (%rax)
	nop
.L24:
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE12:
	.size	chmax, .-chmax
	.globl	chmin
	.type	chmin, @function
chmin:
.LFB13:
	.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)
	movl	%esi, -12(%rbp)
	movq	-8(%rbp), %rax
	movl	(%rax), %eax
	cmpl	%eax, -12(%rbp)
	jge	.L28
	movq	-8(%rbp), %rax
	movl	-12(%rbp), %edx
	movl	%edx, (%rax)
	nop
.L28:
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE13:
	.size	chmin, .-chmin
	.section	.rodata
.LC0:
	.string	"%ld"
.LC2:
	.string	"%ld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB14:
	.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	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-40(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	$0, -32(%rbp)
	movl	$0, -48(%rbp)
	jmp	.L30
.L34:
	pxor	%xmm0, %xmm0
	cvtsi2sdl	-48(%rbp), %xmm0
	movq	.LC1(%rip), %rax
	movapd	%xmm0, %xmm1
	movq	%rax, %xmm0
	call	pow@PLT
	cvttsd2siq	%xmm0, %rax
	movq	%rax, -16(%rbp)
	movq	-40(%rbp), %rax
	cqto
	idivq	-16(%rbp)
	testq	%rax, %rax
	jle	.L39
	movl	-48(%rbp), %eax
	cltq
	movq	%rax, -32(%rbp)
	addl	$1, -48(%rbp)
.L30:
	cmpl	$39, -48(%rbp)
	jle	.L34
	jmp	.L33
.L39:
	nop
.L33:
	movq	$0, -24(%rbp)
	movl	$0, -44(%rbp)
	jmp	.L35
.L36:
	pxor	%xmm0, %xmm0
	cvtsi2sdl	-44(%rbp), %xmm0
	movq	.LC1(%rip), %rax
	movapd	%xmm0, %xmm1
	movq	%rax, %xmm0
	call	pow@PLT
	pxor	%xmm1, %xmm1
	cvtsi2sdq	-24(%rbp), %xmm1
	addsd	%xmm1, %xmm0
	cvttsd2siq	%xmm0, %rax
	movq	%rax, -24(%rbp)
	addl	$1, -44(%rbp)
.L35:
	movl	-44(%rbp), %eax
	cltq
	cmpq	%rax, -32(%rbp)
	jge	.L36
	movq	-24(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L38
	call	__stack_chk_fail@PLT
.L38:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE14:
	.size	main, .-main
	.section	.rodata
	.align 8
.LC1:
	.long	0
	.long	1073741824
	.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	swap
	.type	swap, @function
swap:
.LFB51:
	.cfi_startproc
	endbr64
	movl	(%rdi), %eax
	movl	(%rsi), %edx
	movl	%edx, (%rdi)
	movl	%eax, (%rsi)
	ret
	.cfi_endproc
.LFE51:
	.size	swap, .-swap
	.p2align 4
	.globl	gcd
	.type	gcd, @function
gcd:
.LFB52:
	.cfi_startproc
	endbr64
	movl	%edi, %r8d
	cmpl	%esi, %edi
	jge	.L4
	movl	%esi, %r8d
	movl	%edi, %esi
.L4:
	testl	%esi, %esi
	je	.L3
	movl	%r8d, %eax
	cltd
	idivl	%esi
	movl	%edx, %r8d
	testl	%edx, %edx
	jne	.L6
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L9:
	movl	%edx, %r8d
.L6:
	movl	%esi, %eax
	movl	%r8d, %esi
	cltd
	idivl	%r8d
	testl	%edx, %edx
	jne	.L9
.L3:
	movl	%r8d, %eax
	ret
	.p2align 4,,10
	.p2align 3
.L11:
	movl	%esi, %r8d
	jmp	.L3
	.cfi_endproc
.LFE52:
	.size	gcd, .-gcd
	.p2align 4
	.globl	dn
	.type	dn, @function
dn:
.LFB53:
	.cfi_startproc
	endbr64
	movl	(%rsi), %eax
	subl	(%rdi), %eax
	ret
	.cfi_endproc
.LFE53:
	.size	dn, .-dn
	.p2align 4
	.globl	modpow
	.type	modpow, @function
modpow:
.LFB54:
	.cfi_startproc
	endbr64
	movl	%edx, %ecx
	movl	$1, %r8d
	testl	%esi, %esi
	jle	.L13
	.p2align 4,,10
	.p2align 3
.L16:
	testb	$1, %sil
	je	.L15
	movl	%r8d, %eax
	imull	%edi, %eax
	cltd
	idivl	%ecx
	movl	%edx, %r8d
.L15:
	imull	%edi, %edi
	movl	%edi, %eax
	cltd
	idivl	%ecx
	sarl	%esi
	movl	%edx, %edi
	jne	.L16
.L13:
	movl	%r8d, %eax
	ret
	.cfi_endproc
.LFE54:
	.size	modpow, .-modpow
	.p2align 4
	.globl	max
	.type	max, @function
max:
.LFB55:
	.cfi_startproc
	endbr64
	cmpl	%esi, %edi
	movl	%esi, %eax
	cmovge	%edi, %eax
	ret
	.cfi_endproc
.LFE55:
	.size	max, .-max
	.p2align 4
	.globl	min
	.type	min, @function
min:
.LFB56:
	.cfi_startproc
	endbr64
	cmpl	%esi, %edi
	movl	%esi, %eax
	cmovle	%edi, %eax
	ret
	.cfi_endproc
.LFE56:
	.size	min, .-min
	.p2align 4
	.globl	chmax
	.type	chmax, @function
chmax:
.LFB57:
	.cfi_startproc
	endbr64
	cmpl	%esi, (%rdi)
	jge	.L24
	movl	%esi, (%rdi)
.L24:
	ret
	.cfi_endproc
.LFE57:
	.size	chmax, .-chmax
	.p2align 4
	.globl	chmin
	.type	chmin, @function
chmin:
.LFB58:
	.cfi_startproc
	endbr64
	cmpl	%esi, (%rdi)
	jle	.L26
	movl	%esi, (%rdi)
.L26:
	ret
	.cfi_endproc
.LFE58:
	.size	chmin, .-chmin
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%ld"
.LC2:
	.string	"%ld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB59:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	leaq	.LC0(%rip), %rdi
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	xorl	%r12d, %r12d
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	xorl	%ebx, %ebx
	subq	$24, %rsp
	.cfi_def_cfa_offset 64
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	movq	%rsp, %rsi
	call	__isoc99_scanf@PLT
	movq	(%rsp), %rbp
	jmp	.L30
	.p2align 4,,10
	.p2align 3
.L36:
	movq	%rbx, %r12
	addq	$1, %rbx
	cmpq	$40, %rbx
	je	.L29
.L30:
	pxor	%xmm1, %xmm1
	movq	.LC1(%rip), %rax
	cvtsi2sdl	%ebx, %xmm1
	movq	%rax, %xmm0
	call	pow@PLT
	movq	%rbp, %rax
	cvttsd2siq	%xmm0, %rcx
	cqto
	idivq	%rcx
	testq	%rax, %rax
	jg	.L36
.L29:
	addl	$1, %r12d
	xorl	%ebx, %ebx
	xorl	%r13d, %r13d
	.p2align 4,,10
	.p2align 3
.L31:
	pxor	%xmm1, %xmm1
	movq	.LC1(%rip), %rax
	cvtsi2sdl	%ebx, %xmm1
	addl	$1, %ebx
	movq	%rax, %xmm0
	call	pow@PLT
	movapd	%xmm0, %xmm1
	pxor	%xmm0, %xmm0
	cvtsi2sdq	%r13, %xmm0
	addsd	%xmm1, %xmm0
	cvttsd2siq	%xmm0, %r13
	cmpl	%ebx, %r12d
	jne	.L31
	xorl	%eax, %eax
	movq	%r13, %rdx
	movl	$1, %edi
	leaq	.LC2(%rip), %rsi
	call	__printf_chk@PLT
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L37
	addq	$24, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	xorl	%eax, %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
.L37:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE59:
	.size	main, .-main
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC1:
	.long	0
	.long	1073741824
	.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	swap
	.type	swap, @function
swap:
.LFB51:
	.cfi_startproc
	endbr64
	movl	(%rdi), %eax
	movl	(%rsi), %edx
	movl	%edx, (%rdi)
	movl	%eax, (%rsi)
	ret
	.cfi_endproc
.LFE51:
	.size	swap, .-swap
	.p2align 4
	.globl	gcd
	.type	gcd, @function
gcd:
.LFB52:
	.cfi_startproc
	endbr64
	movl	%edi, %r8d
	cmpl	%esi, %edi
	jge	.L4
	movl	%esi, %r8d
	movl	%edi, %esi
.L4:
	testl	%esi, %esi
	je	.L3
	movl	%r8d, %eax
	cltd
	idivl	%esi
	movl	%edx, %r8d
	testl	%edx, %edx
	jne	.L6
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L9:
	movl	%edx, %r8d
.L6:
	movl	%esi, %eax
	movl	%r8d, %esi
	cltd
	idivl	%r8d
	testl	%edx, %edx
	jne	.L9
.L3:
	movl	%r8d, %eax
	ret
	.p2align 4,,10
	.p2align 3
.L11:
	movl	%esi, %r8d
	jmp	.L3
	.cfi_endproc
.LFE52:
	.size	gcd, .-gcd
	.p2align 4
	.globl	dn
	.type	dn, @function
dn:
.LFB53:
	.cfi_startproc
	endbr64
	movl	(%rsi), %eax
	subl	(%rdi), %eax
	ret
	.cfi_endproc
.LFE53:
	.size	dn, .-dn
	.p2align 4
	.globl	modpow
	.type	modpow, @function
modpow:
.LFB54:
	.cfi_startproc
	endbr64
	movl	%edx, %ecx
	movl	$1, %r8d
	testl	%esi, %esi
	jle	.L13
	.p2align 4,,10
	.p2align 3
.L16:
	testb	$1, %sil
	je	.L15
	movl	%r8d, %eax
	imull	%edi, %eax
	cltd
	idivl	%ecx
	movl	%edx, %r8d
.L15:
	imull	%edi, %edi
	movl	%edi, %eax
	cltd
	idivl	%ecx
	sarl	%esi
	movl	%edx, %edi
	jne	.L16
.L13:
	movl	%r8d, %eax
	ret
	.cfi_endproc
.LFE54:
	.size	modpow, .-modpow
	.p2align 4
	.globl	max
	.type	max, @function
max:
.LFB55:
	.cfi_startproc
	endbr64
	cmpl	%esi, %edi
	movl	%esi, %eax
	cmovge	%edi, %eax
	ret
	.cfi_endproc
.LFE55:
	.size	max, .-max
	.p2align 4
	.globl	min
	.type	min, @function
min:
.LFB56:
	.cfi_startproc
	endbr64
	cmpl	%esi, %edi
	movl	%esi, %eax
	cmovle	%edi, %eax
	ret
	.cfi_endproc
.LFE56:
	.size	min, .-min
	.p2align 4
	.globl	chmax
	.type	chmax, @function
chmax:
.LFB57:
	.cfi_startproc
	endbr64
	cmpl	%esi, (%rdi)
	jge	.L24
	movl	%esi, (%rdi)
.L24:
	ret
	.cfi_endproc
.LFE57:
	.size	chmax, .-chmax
	.p2align 4
	.globl	chmin
	.type	chmin, @function
chmin:
.LFB58:
	.cfi_startproc
	endbr64
	cmpl	%esi, (%rdi)
	jle	.L26
	movl	%esi, (%rdi)
.L26:
	ret
	.cfi_endproc
.LFE58:
	.size	chmin, .-chmin
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%ld"
.LC2:
	.string	"%ld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB59:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	leaq	.LC0(%rip), %rdi
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	xorl	%r12d, %r12d
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	xorl	%ebx, %ebx
	subq	$24, %rsp
	.cfi_def_cfa_offset 64
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	movq	%rsp, %rsi
	call	__isoc99_scanf@PLT
	movq	(%rsp), %rbp
	jmp	.L30
	.p2align 4,,10
	.p2align 3
.L36:
	movq	%rbx, %r12
	addq	$1, %rbx
	cmpq	$40, %rbx
	je	.L29
.L30:
	pxor	%xmm1, %xmm1
	movq	.LC1(%rip), %rax
	cvtsi2sdl	%ebx, %xmm1
	movq	%rax, %xmm0
	call	pow@PLT
	movq	%rbp, %rax
	cvttsd2siq	%xmm0, %rcx
	cqto
	idivq	%rcx
	testq	%rax, %rax
	jg	.L36
.L29:
	addl	$1, %r12d
	xorl	%ebx, %ebx
	xorl	%r13d, %r13d
	.p2align 4,,10
	.p2align 3
.L31:
	pxor	%xmm1, %xmm1
	movq	.LC1(%rip), %rax
	cvtsi2sdl	%ebx, %xmm1
	addl	$1, %ebx
	movq	%rax, %xmm0
	call	pow@PLT
	movapd	%xmm0, %xmm1
	pxor	%xmm0, %xmm0
	cvtsi2sdq	%r13, %xmm0
	addsd	%xmm1, %xmm0
	cvttsd2siq	%xmm0, %r13
	cmpl	%ebx, %r12d
	jne	.L31
	xorl	%eax, %eax
	movq	%r13, %rdx
	movl	$1, %edi
	leaq	.LC2(%rip), %rsi
	call	__printf_chk@PLT
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L37
	addq	$24, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	xorl	%eax, %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
.L37:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE59:
	.size	main, .-main
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC1:
	.long	0
	.long	1073741824
	.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 <math.h>
#include <string.h>
 
 
void swap (int *x, int *y) {
  int temp;    
 
  temp = *x;
  *x = *y;
  *y = temp;
}
 
int gcd(int a,int b){
  if(a<b){
    swap(&a,&b);
  }
 
  if(b==0){
    return a;
  }
 
  int r=a%b;
  while(r!=0){
    a = b;
    b = r;
    r = (a%b);
  }
 
  return b;
}
 
/* クイックソート */
int dn(const void*a,const void*b){return*(int*)b-*(int*)a;}
 
 
int modpow(int a,int n,int mod){
  int ans=1;
  while(n>0){
    if(n & 1){
      ans=ans*a%mod;
    }
    a=a*a%mod;
    n/=2;
  }
  return ans;
}
 
int max(int a,int b){
  if(a<b){
    return b;
  }
  else{
    return a;
  }
}
 
int min(int a,int b){
  if(a<b){
    return a;
  }
  else{
    return b;
  }
}
 
void chmax(int *a,int b){
  if(*a < b){
    *a = b;
  }
 
  return;
}
 
void chmin(int *a,int b){
  if(*a > b){
    *a =b;
  }
 
  return;
}
 

int main(void){
  long int h;
  scanf("%ld",&h);
  long int max=0;
  long int d;
  for(int i=0;i<40;i++){
    d=pow(2,i);
    if(h/d>=1){
      max=i;
    }else{
      break;
    }
  }
  long int sum=0;
  for(int i=0;i<max+1;i++){
    sum+=pow(2,i);
  }
  printf("%ld\n",sum);
  return 0;
}
8
 1010000000000
 3
 7
 1
 18
 1110100001000
 46
 77
 140

15
 1099511627775
 3
 7
 1
 31
 1099511627775
 63
 127
 255

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 <math.h>
#include <string.h>
 
 
void swap (int *x, int *y) {
  int temp;    
 
  temp = *x;
  *x = *y;
  *y = temp;
}
 
int gcd(int a,int b){
  if(a<b){
    swap(&a,&b);
  }
 
  if(b==0){
    return a;
  }
 
  int r=a%b;
  while(r!=0){
    a = b;
    b = r;
    r = (a%b);
  }
 
  return b;
}
 
/* クイックソート */
int dn(const void*a,const void*b){return*(int*)b-*(int*)a;}
 
 
int modpow(int a,int n,int mod){
  int ans=1;
  while(n>0){
    if(n & 1){
      ans=ans*a%mod;
    }
    a=a*a%mod;
    n/=2;
  }
  return ans;
}
 
int max(int a,int b){
  if(a<b){
    return b;
  }
  else{
    return a;
  }
}
 
int min(int a,int b){
  if(a<b){
    return a;
  }
  else{
    return b;
  }
}
 
void chmax(int *a,int b){
  if(*a < b){
    *a = b;
  }
 
  return;
}
 
void chmin(int *a,int b){
  if(*a > b){
    *a =b;
  }
 
  return;
}
 

int main(void){
  long int h;
  scanf("%ld",&h);
  long int max=0;
  long int d;
  for(int i=0;i<40;i++){
    d=pow(2,i);
    if(h/d>=1){
      max=i;
    }else{
      break;
    }
  }
  long int sum=0;
  for(int i=0;i<max+1;i++){
    sum+=pow(2,i);
  }
  printf("%ld\n",sum);
  return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	swap
	.type	swap, @function
swap:
.LFB6:
	.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
	movl	(%rax), %eax
	movl	%eax, -4(%rbp)
	movq	-32(%rbp), %rax
	movl	(%rax), %edx
	movq	-24(%rbp), %rax
	movl	%edx, (%rax)
	movq	-32(%rbp), %rax
	movl	-4(%rbp), %edx
	movl	%edx, (%rax)
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	swap, .-swap
	.globl	gcd
	.type	gcd, @function
gcd:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$24, %rsp
	movl	%edi, -20(%rbp)
	movl	%esi, -24(%rbp)
	movl	-20(%rbp), %edx
	movl	-24(%rbp), %eax
	cmpl	%eax, %edx
	jge	.L3
	leaq	-24(%rbp), %rdx
	leaq	-20(%rbp), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	swap
.L3:
	movl	-24(%rbp), %eax
	testl	%eax, %eax
	jne	.L4
	movl	-20(%rbp), %eax
	jmp	.L5
.L4:
	movl	-20(%rbp), %eax
	movl	-24(%rbp), %ecx
	cltd
	idivl	%ecx
	movl	%edx, -4(%rbp)
	jmp	.L6
.L7:
	movl	-24(%rbp), %eax
	movl	%eax, -20(%rbp)
	movl	-4(%rbp), %eax
	movl	%eax, -24(%rbp)
	movl	-20(%rbp), %eax
	movl	-24(%rbp), %ecx
	cltd
	idivl	%ecx
	movl	%edx, -4(%rbp)
.L6:
	cmpl	$0, -4(%rbp)
	jne	.L7
	movl	-24(%rbp), %eax
.L5:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	gcd, .-gcd
	.globl	dn
	.type	dn, @function
dn:
.LFB8:
	.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	%rsi, -16(%rbp)
	movq	-16(%rbp), %rax
	movl	(%rax), %edx
	movq	-8(%rbp), %rax
	movl	(%rax), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	dn, .-dn
	.globl	modpow
	.type	modpow, @function
modpow:
.LFB9:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -20(%rbp)
	movl	%esi, -24(%rbp)
	movl	%edx, -28(%rbp)
	movl	$1, -4(%rbp)
	jmp	.L11
.L13:
	movl	-24(%rbp), %eax
	andl	$1, %eax
	testl	%eax, %eax
	je	.L12
	movl	-4(%rbp), %eax
	imull	-20(%rbp), %eax
	cltd
	idivl	-28(%rbp)
	movl	%edx, -4(%rbp)
.L12:
	movl	-20(%rbp), %eax
	imull	%eax, %eax
	cltd
	idivl	-28(%rbp)
	movl	%edx, -20(%rbp)
	movl	-24(%rbp), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, -24(%rbp)
.L11:
	cmpl	$0, -24(%rbp)
	jg	.L13
	movl	-4(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	modpow, .-modpow
	.globl	max
	.type	max, @function
max:
.LFB10:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	-4(%rbp), %eax
	cmpl	-8(%rbp), %eax
	jge	.L16
	movl	-8(%rbp), %eax
	jmp	.L17
.L16:
	movl	-4(%rbp), %eax
.L17:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.size	max, .-max
	.globl	min
	.type	min, @function
min:
.LFB11:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	-4(%rbp), %eax
	cmpl	-8(%rbp), %eax
	jge	.L19
	movl	-4(%rbp), %eax
	jmp	.L20
.L19:
	movl	-8(%rbp), %eax
.L20:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE11:
	.size	min, .-min
	.globl	chmax
	.type	chmax, @function
chmax:
.LFB12:
	.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)
	movl	%esi, -12(%rbp)
	movq	-8(%rbp), %rax
	movl	(%rax), %eax
	cmpl	%eax, -12(%rbp)
	jle	.L24
	movq	-8(%rbp), %rax
	movl	-12(%rbp), %edx
	movl	%edx, (%rax)
	nop
.L24:
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE12:
	.size	chmax, .-chmax
	.globl	chmin
	.type	chmin, @function
chmin:
.LFB13:
	.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)
	movl	%esi, -12(%rbp)
	movq	-8(%rbp), %rax
	movl	(%rax), %eax
	cmpl	%eax, -12(%rbp)
	jge	.L28
	movq	-8(%rbp), %rax
	movl	-12(%rbp), %edx
	movl	%edx, (%rax)
	nop
.L28:
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE13:
	.size	chmin, .-chmin
	.section	.rodata
.LC0:
	.string	"%ld"
.LC2:
	.string	"%ld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB14:
	.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	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-40(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	$0, -32(%rbp)
	movl	$0, -48(%rbp)
	jmp	.L30
.L34:
	pxor	%xmm0, %xmm0
	cvtsi2sdl	-48(%rbp), %xmm0
	movq	.LC1(%rip), %rax
	movapd	%xmm0, %xmm1
	movq	%rax, %xmm0
	call	pow@PLT
	cvttsd2siq	%xmm0, %rax
	movq	%rax, -16(%rbp)
	movq	-40(%rbp), %rax
	cqto
	idivq	-16(%rbp)
	testq	%rax, %rax
	jle	.L39
	movl	-48(%rbp), %eax
	cltq
	movq	%rax, -32(%rbp)
	addl	$1, -48(%rbp)
.L30:
	cmpl	$39, -48(%rbp)
	jle	.L34
	jmp	.L33
.L39:
	nop
.L33:
	movq	$0, -24(%rbp)
	movl	$0, -44(%rbp)
	jmp	.L35
.L36:
	pxor	%xmm0, %xmm0
	cvtsi2sdl	-44(%rbp), %xmm0
	movq	.LC1(%rip), %rax
	movapd	%xmm0, %xmm1
	movq	%rax, %xmm0
	call	pow@PLT
	pxor	%xmm1, %xmm1
	cvtsi2sdq	-24(%rbp), %xmm1
	addsd	%xmm1, %xmm0
	cvttsd2siq	%xmm0, %rax
	movq	%rax, -24(%rbp)
	addl	$1, -44(%rbp)
.L35:
	movl	-44(%rbp), %eax
	cltq
	cmpq	%rax, -32(%rbp)
	jge	.L36
	movq	-24(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L38
	call	__stack_chk_fail@PLT
.L38:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE14:
	.size	main, .-main
	.section	.rodata
	.align 8
.LC1:
	.long	0
	.long	1073741824
	.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	swap
	.type	swap, @function
swap:
.LFB6:
	.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
	movl	(%rax), %eax
	movl	%eax, -4(%rbp)
	movq	-32(%rbp), %rax
	movl	(%rax), %edx
	movq	-24(%rbp), %rax
	movl	%edx, (%rax)
	movq	-32(%rbp), %rax
	movl	-4(%rbp), %edx
	movl	%edx, (%rax)
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	swap, .-swap
	.globl	gcd
	.type	gcd, @function
gcd:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$24, %rsp
	movl	%edi, -20(%rbp)
	movl	%esi, -24(%rbp)
	movl	-20(%rbp), %edx
	movl	-24(%rbp), %eax
	cmpl	%eax, %edx
	jge	.L3
	leaq	-24(%rbp), %rdx
	leaq	-20(%rbp), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	swap
.L3:
	movl	-24(%rbp), %eax
	testl	%eax, %eax
	jne	.L4
	movl	-20(%rbp), %eax
	jmp	.L5
.L4:
	movl	-20(%rbp), %eax
	movl	-24(%rbp), %ecx
	cltd
	idivl	%ecx
	movl	%edx, -4(%rbp)
	jmp	.L6
.L7:
	movl	-24(%rbp), %eax
	movl	%eax, -20(%rbp)
	movl	-4(%rbp), %eax
	movl	%eax, -24(%rbp)
	movl	-20(%rbp), %eax
	movl	-24(%rbp), %ecx
	cltd
	idivl	%ecx
	movl	%edx, -4(%rbp)
.L6:
	cmpl	$0, -4(%rbp)
	jne	.L7
	movl	-24(%rbp), %eax
.L5:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	gcd, .-gcd
	.globl	dn
	.type	dn, @function
dn:
.LFB8:
	.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	%rsi, -16(%rbp)
	movq	-16(%rbp), %rax
	movl	(%rax), %edx
	movq	-8(%rbp), %rax
	movl	(%rax), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	dn, .-dn
	.globl	modpow
	.type	modpow, @function
modpow:
.LFB9:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -20(%rbp)
	movl	%esi, -24(%rbp)
	movl	%edx, -28(%rbp)
	movl	$1, -4(%rbp)
	jmp	.L11
.L13:
	movl	-24(%rbp), %eax
	andl	$1, %eax
	testl	%eax, %eax
	je	.L12
	movl	-4(%rbp), %eax
	imull	-20(%rbp), %eax
	cltd
	idivl	-28(%rbp)
	movl	%edx, -4(%rbp)
.L12:
	movl	-20(%rbp), %eax
	imull	%eax, %eax
	cltd
	idivl	-28(%rbp)
	movl	%edx, -20(%rbp)
	movl	-24(%rbp), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, -24(%rbp)
.L11:
	cmpl	$0, -24(%rbp)
	jg	.L13
	movl	-4(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	modpow, .-modpow
	.globl	max
	.type	max, @function
max:
.LFB10:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	-4(%rbp), %eax
	cmpl	-8(%rbp), %eax
	jge	.L16
	movl	-8(%rbp), %eax
	jmp	.L17
.L16:
	movl	-4(%rbp), %eax
.L17:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.size	max, .-max
	.globl	min
	.type	min, @function
min:
.LFB11:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	-4(%rbp), %eax
	cmpl	-8(%rbp), %eax
	jge	.L19
	movl	-4(%rbp), %eax
	jmp	.L20
.L19:
	movl	-8(%rbp), %eax
.L20:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE11:
	.size	min, .-min
	.globl	chmax
	.type	chmax, @function
chmax:
.LFB12:
	.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)
	movl	%esi, -12(%rbp)
	movq	-8(%rbp), %rax
	movl	(%rax), %eax
	cmpl	%eax, -12(%rbp)
	jle	.L24
	movq	-8(%rbp), %rax
	movl	-12(%rbp), %edx
	movl	%edx, (%rax)
	nop
.L24:
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE12:
	.size	chmax, .-chmax
	.globl	chmin
	.type	chmin, @function
chmin:
.LFB13:
	.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)
	movl	%esi, -12(%rbp)
	movq	-8(%rbp), %rax
	movl	(%rax), %eax
	cmpl	%eax, -12(%rbp)
	jge	.L28
	movq	-8(%rbp), %rax
	movl	-12(%rbp), %edx
	movl	%edx, (%rax)
	nop
.L28:
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE13:
	.size	chmin, .-chmin
	.section	.rodata
.LC0:
	.string	"%ld"
.LC2:
	.string	"%ld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB14:
	.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	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-40(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	$0, -32(%rbp)
	movl	$0, -48(%rbp)
	jmp	.L30
.L34:
	pxor	%xmm0, %xmm0
	cvtsi2sdl	-48(%rbp), %xmm0
	movq	.LC1(%rip), %rax
	movapd	%xmm0, %xmm1
	movq	%rax, %xmm0
	call	pow@PLT
	cvttsd2siq	%xmm0, %rax
	movq	%rax, -16(%rbp)
	movq	-40(%rbp), %rax
	cqto
	idivq	-16(%rbp)
	testq	%rax, %rax
	jle	.L39
	movl	-48(%rbp), %eax
	cltq
	movq	%rax, -32(%rbp)
	addl	$1, -48(%rbp)
.L30:
	cmpl	$39, -48(%rbp)
	jle	.L34
	jmp	.L33
.L39:
	nop
.L33:
	movq	$0, -24(%rbp)
	movl	$0, -44(%rbp)
	jmp	.L35
.L36:
	pxor	%xmm0, %xmm0
	cvtsi2sdl	-44(%rbp), %xmm0
	movq	.LC1(%rip), %rax
	movapd	%xmm0, %xmm1
	movq	%rax, %xmm0
	call	pow@PLT
	pxor	%xmm1, %xmm1
	cvtsi2sdq	-24(%rbp), %xmm1
	addsd	%xmm1, %xmm0
	cvttsd2siq	%xmm0, %rax
	movq	%rax, -24(%rbp)
	addl	$1, -44(%rbp)
.L35:
	movl	-44(%rbp), %eax
	cltq
	cmpq	%rax, -32(%rbp)
	jge	.L36
	movq	-24(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L38
	call	__stack_chk_fail@PLT
.L38:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE14:
	.size	main, .-main
	.section	.rodata
	.align 8
.LC1:
	.long	0
	.long	1073741824
	.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:
