	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal16,16byte_literals
	.p2align	4                               ## -- Begin function gl_core_set_viewport
LCPI0_0:
	.long	0x7fffffff                      ## float NaN
	.long	0x7fffffff                      ## float NaN
	.long	0x7fffffff                      ## float NaN
	.long	0x7fffffff                      ## float NaN
	.section	__TEXT,__literal4,4byte_literals
	.p2align	2
LCPI0_1:
	.long	0x38d1b717                      ## float 9.99999974E-5
LCPI0_2:
	.long	0xbf800000                      ## float -1
LCPI0_3:
	.long	0x3f000000                      ## float 0.5
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	4, 0x90
_gl_core_set_viewport:                  ## @gl_core_set_viewport
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%ecx, %r12d
	movl	%edx, %r13d
	movl	%edx, %eax
	cvtsi2ss	%rax, %xmm0
	movl	%ecx, %eax
	cvtsi2ss	%rax, %xmm1
	movl	%r9d, -56(%rbp)                 ## 4-byte Spill
	movl	%r8d, %ebx
	movq	%rsi, %r14
	movq	%rdi, %r15
	movss	%xmm0, -48(%rbp)                ## 4-byte Spill
	movss	%xmm1, -44(%rbp)                ## 4-byte Spill
	divss	%xmm1, %xmm0
	movss	%xmm0, -52(%rbp)
	leaq	-52(%rbp), %rax
	movq	%rax, -80(%rbp)
	movl	%edx, -72(%rbp)
	movl	%ecx, -68(%rbp)
	leaq	-80(%rbp), %rdi
	callq	_video_context_driver_translate_aspect
	testl	%ebx, %ebx
	movl	%ebx, -60(%rbp)                 ## 4-byte Spill
	jne	LBB0_3
## %bb.1:
	cmpq	$0, 16(%r14)
	je	LBB0_3
## %bb.2:
	leaq	8(%r15), %r14
	xorl	%eax, %eax
	callq	_video_driver_get_aspect_ratio
	movq	40(%r15), %rcx
	movq	%r14, %rdi
	movl	%r13d, %esi
	movl	%r12d, %edx
	callq	_video_viewport_get_scaled_integer
	movl	8(%r15), %r13d
	movl	12(%r15), %r12d
	movl	16(%r15), %r14d
	movl	20(%r15), %ebx
	jmp	LBB0_12
LBB0_3:
	testl	%ebx, %ebx
	jne	LBB0_11
## %bb.4:
	cmpq	$0, 40(%r15)
	je	LBB0_11
## %bb.5:
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_video_driver_get_aspect_ratio
	movaps	%xmm0, %xmm2
	movss	-52(%rbp), %xmm3                ## xmm3 = mem[0],zero,zero,zero
	movaps	%xmm3, %xmm0
	subss	%xmm2, %xmm0
	andps	LCPI0_0(%rip), %xmm0
	movss	LCPI0_1(%rip), %xmm1            ## xmm1 = mem[0],zero,zero,zero
	ucomiss	%xmm0, %xmm1
	ja	LBB0_9
## %bb.6:
	ucomiss	%xmm2, %xmm3
	jbe	LBB0_8
## %bb.7:
	divss	%xmm3, %xmm2
	addss	LCPI0_2(%rip), %xmm2
	movss	LCPI0_3(%rip), %xmm0            ## xmm0 = mem[0],zero,zero,zero
	mulss	%xmm0, %xmm2
	addss	%xmm0, %xmm2
	movss	%xmm2, -44(%rbp)                ## 4-byte Spill
	subss	%xmm2, %xmm0
	mulss	-48(%rbp), %xmm0                ## 4-byte Folded Reload
	callq	_roundf
	movq	%rax, %r14
	movss	-48(%rbp), %xmm0                ## 4-byte Reload
                                        ## xmm0 = mem[0],zero,zero,zero
	addss	%xmm0, %xmm0
	mulss	-44(%rbp), %xmm0                ## 4-byte Folded Reload
	callq	_roundf
	movq	%rax, %r13
	jmp	LBB0_10
LBB0_11:
	movq	$0, 16(%r15)
	movl	%r13d, 8(%r15)
	movl	%r12d, 12(%r15)
	xorl	%ebx, %ebx
	xorl	%r14d, %r14d
	jmp	LBB0_12
LBB0_8:
	divss	%xmm2, %xmm3
	addss	LCPI0_2(%rip), %xmm3
	movss	LCPI0_3(%rip), %xmm0            ## xmm0 = mem[0],zero,zero,zero
	mulss	%xmm0, %xmm3
	addss	%xmm0, %xmm3
	movss	%xmm3, -48(%rbp)                ## 4-byte Spill
	subss	%xmm3, %xmm0
	mulss	-44(%rbp), %xmm0                ## 4-byte Folded Reload
	callq	_roundf
	movq	%rax, %rbx
	movss	-44(%rbp), %xmm0                ## 4-byte Reload
                                        ## xmm0 = mem[0],zero,zero,zero
	addss	%xmm0, %xmm0
	mulss	-48(%rbp), %xmm0                ## 4-byte Folded Reload
	callq	_roundf
	movq	%rax, %r12
LBB0_9:
	xorl	%r14d, %r14d
LBB0_10:
	movl	%r14d, 16(%r15)
	movl	%ebx, 20(%r15)
	movl	%r13d, 8(%r15)
	movl	%r12d, 12(%r15)
LBB0_12:
	movl	%r14d, %edi
	movl	%ebx, %esi
	movl	%r13d, %edx
	movl	%r12d, %ecx
	callq	_glViewport
	movq	_gl_core_default_ortho@GOTPCREL(%rip), %rsi
	movq	%r15, %rdi
	movl	-56(%rbp), %edx                 ## 4-byte Reload
	callq	_gl_core_set_projection
	cmpl	$0, -60(%rbp)                   ## 4-byte Folded Reload
	jne	LBB0_14
## %bb.13:
	movl	%r13d, (%r15)
	movl	%r12d, 4(%r15)
LBB0_14:
	movdqu	8(%r15), %xmm0
	pshufd	$78, %xmm0, %xmm0               ## xmm0 = xmm0[2,3,0,1]
	movdqu	%xmm0, 24(%r15)
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_gl_core_default_ortho,4,2      ## @gl_core_default_ortho
	.comm	_ASPECT_RATIO_CUSTOM,8,3        ## @ASPECT_RATIO_CUSTOM
	.no_dead_strip	_gl_core_set_viewport
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function gl_core_set_viewport
_gl_core_set_viewport:                  ; @gl_core_set_viewport
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	d9, d8, [sp, #32]               ; 16-byte Folded Spill
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset b8, -88
	.cfi_offset b9, -96
	mov	x21, x5
	mov	x20, x4
	mov	x22, x3
	mov	x23, x2
	mov	x24, x1
	mov	x19, x0
	ucvtf	s8, w2
	ucvtf	s9, w3
	fdiv	s0, s8, s9
	str	s0, [sp, #12]
	add	x8, sp, #12
	str	x8, [sp, #16]
	stp	w2, w3, [sp, #24]
	add	x0, sp, #16
	bl	_video_context_driver_translate_aspect
	cbnz	w20, LBB0_3
; %bb.1:
	ldr	x8, [x24, #16]
	cbz	x8, LBB0_3
; %bb.2:
	add	x24, x19, #8
	bl	_video_driver_get_aspect_ratio
	ldr	x3, [x19, #40]
	mov	x0, x24
	mov	x1, x23
	mov	x2, x22
	bl	_video_viewport_get_scaled_integer
	ldp	w23, w22, [x19, #8]
	ldp	w24, w25, [x19, #16]
	b	LBB0_13
LBB0_3:
	cbnz	w20, LBB0_7
; %bb.4:
	ldr	x8, [x19, #40]
	cbz	x8, LBB0_7
; %bb.5:
	bl	_video_driver_get_aspect_ratio
	ldr	s1, [sp, #12]
	fabd	s2, s1, s0
	mov	w8, #46871
	movk	w8, #14545, lsl #16
	fmov	s3, w8
	fcmp	s2, s3
	b.pl	LBB0_8
; %bb.6:
	mov	w24, #0
	mov	w25, #0
	b	LBB0_11
LBB0_7:
	mov	w25, #0
	mov	w24, #0
	str	xzr, [x19, #16]
	b	LBB0_12
LBB0_8:
	fcmp	s1, s0
	b.le	LBB0_10
; %bb.9:
	fdiv	s0, s0, s1
	fmov	s1, #-1.00000000
	fadd	s0, s0, s1
	fmov	s1, #0.50000000
	fmul	s0, s0, s1
	fadd	s9, s0, s1
	fsub	s0, s1, s9
	fmul	s0, s0, s8
	bl	_roundf
	mov	x24, x0
	fadd	s0, s8, s8
	fmul	s0, s0, s9
	bl	_roundf
	mov	x23, x0
	mov	w25, #0
	b	LBB0_11
LBB0_10:
	fdiv	s0, s1, s0
	fmov	s1, #-1.00000000
	fadd	s0, s0, s1
	fmov	s1, #0.50000000
	fmul	s0, s0, s1
	fadd	s8, s0, s1
	fsub	s0, s1, s8
	fmul	s0, s0, s9
	bl	_roundf
	mov	x25, x0
	fadd	s0, s9, s9
	fmul	s0, s0, s8
	bl	_roundf
	mov	x22, x0
	mov	w24, #0
LBB0_11:
	stp	w24, w25, [x19, #16]
LBB0_12:
	stp	w23, w22, [x19, #8]
LBB0_13:
	mov	x0, x24
	mov	x1, x25
	mov	x2, x23
	mov	x3, x22
	bl	_glViewport
Lloh0:
	adrp	x1, _gl_core_default_ortho@GOTPAGE
Lloh1:
	ldr	x1, [x1, _gl_core_default_ortho@GOTPAGEOFF]
	mov	x0, x19
	mov	x2, x21
	bl	_gl_core_set_projection
	cbnz	w20, LBB0_15
; %bb.14:
	stp	w23, w22, [x19]
LBB0_15:
	ldur	q0, [x19, #8]
	ext.16b	v0, v0, v0, #8
	stur	q0, [x19, #24]
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	d9, d8, [sp, #32]               ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.comm	_gl_core_default_ortho,4,2      ; @gl_core_default_ortho
	.comm	_ASPECT_RATIO_CUSTOM,8,3        ; @ASPECT_RATIO_CUSTOM
	.no_dead_strip	_gl_core_set_viewport
.subsections_via_symbols
