	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal16,16byte_literals
	.p2align	4                               ## -- Begin function wiiu_gfx_update_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
_wiiu_gfx_update_viewport:              ## @wiiu_gfx_update_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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	movl	24(%rdi), %r15d
	movl	28(%rdi), %r14d
	xorl	%eax, %eax
	callq	_config_get_ptr
	cmpq	$0, 8(%rax)
	je	LBB0_2
## %bb.1:
	xorl	%eax, %eax
	callq	_video_driver_get_aspect_ratio
	movq	16(%rbx), %rcx
	movq	%rbx, %rdi
	movl	%r15d, %esi
	movl	%r14d, %edx
	callq	_video_viewport_get_scaled_integer
	jmp	LBB0_11
LBB0_2:
	cmpq	$0, 16(%rbx)
	je	LBB0_9
## %bb.3:
	cvtsi2ss	%r15, %xmm0
	cvtsi2ss	%r14, %xmm1
	movss	%xmm0, -52(%rbp)                ## 4-byte Spill
	movss	%xmm1, -48(%rbp)                ## 4-byte Spill
	divss	%xmm1, %xmm0
	movss	%xmm0, -44(%rbp)                ## 4-byte Spill
	xorl	%r12d, %r12d
	xorl	%eax, %eax
	callq	_video_driver_get_aspect_ratio
	movss	-44(%rbp), %xmm3                ## 4-byte Reload
                                        ## xmm3 = mem[0],zero,zero,zero
	movaps	%xmm0, %xmm4
	movaps	%xmm3, %xmm0
	subss	%xmm4, %xmm0
	andps	LCPI0_0(%rip), %xmm0
	movss	LCPI0_1(%rip), %xmm1            ## xmm1 = mem[0],zero,zero,zero
	ucomiss	%xmm0, %xmm1
	jbe	LBB0_5
## %bb.4:
	xorl	%r13d, %r13d
	jmp	LBB0_8
LBB0_9:
	movq	$0, 8(%rbx)
	jmp	LBB0_10
LBB0_5:
	movss	-48(%rbp), %xmm2                ## 4-byte Reload
                                        ## xmm2 = mem[0],zero,zero,zero
	movss	-52(%rbp), %xmm1                ## 4-byte Reload
                                        ## xmm1 = mem[0],zero,zero,zero
	ucomiss	%xmm4, %xmm3
	jbe	LBB0_7
## %bb.6:
	divss	%xmm3, %xmm4
	addss	LCPI0_2(%rip), %xmm4
	movss	LCPI0_3(%rip), %xmm0            ## xmm0 = mem[0],zero,zero,zero
	mulss	%xmm0, %xmm4
	addss	%xmm0, %xmm4
	movss	%xmm4, -44(%rbp)                ## 4-byte Spill
	subss	%xmm4, %xmm0
	mulss	%xmm1, %xmm0
	callq	_roundf
	movq	%rax, %r12
	movss	-52(%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, %r15
	xorl	%r13d, %r13d
	jmp	LBB0_8
LBB0_7:
	divss	%xmm4, %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, -44(%rbp)                ## 4-byte Spill
	subss	%xmm3, %xmm0
	mulss	%xmm2, %xmm0
	callq	_roundf
	movq	%rax, %r13
	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, %r14
LBB0_8:
	movl	%r12d, 8(%rbx)
	movl	%r13d, 12(%rbx)
LBB0_10:
	movl	%r15d, (%rbx)
	movl	%r14d, 4(%rbx)
LBB0_11:
	movq	%rbx, %rdi
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_wiiu_set_projection            ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_ASPECT_RATIO_CUSTOM,8,3        ## @ASPECT_RATIO_CUSTOM
	.no_dead_strip	_wiiu_gfx_update_viewport
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function wiiu_gfx_update_viewport
_wiiu_gfx_update_viewport:              ; @wiiu_gfx_update_viewport
	.cfi_startproc
; %bb.0:
	stp	d11, d10, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	d9, d8, [sp, #16]               ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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 b8, -72
	.cfi_offset b9, -80
	.cfi_offset b10, -88
	.cfi_offset b11, -96
	mov	x19, x0
	ldp	w21, w20, [x0, #24]
	bl	_config_get_ptr
	ldr	x8, [x0, #8]
	cbz	x8, LBB0_2
; %bb.1:
	bl	_video_driver_get_aspect_ratio
	ldr	x3, [x19, #16]
	mov	x0, x19
	mov	x1, x21
	mov	x2, x20
	bl	_video_viewport_get_scaled_integer
	b	LBB0_12
LBB0_2:
	ldr	x8, [x19, #16]
	cbz	x8, LBB0_5
; %bb.3:
	ucvtf	s8, w21
	ucvtf	s9, w20
	fdiv	s10, s8, s9
	bl	_video_driver_get_aspect_ratio
	fabd	s1, s10, s0
	mov	w8, #46871
	movk	w8, #14545, lsl #16
	fmov	s2, w8
	fcmp	s1, s2
	b.pl	LBB0_6
; %bb.4:
	mov	w22, #0
	b	LBB0_9
LBB0_5:
	str	xzr, [x19, #8]
	b	LBB0_11
LBB0_6:
	fcmp	s10, s0
	b.le	LBB0_8
; %bb.7:
	fdiv	s0, s0, s10
	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	x23, x0
	fadd	s0, s8, s8
	fmul	s0, s0, s9
	bl	_roundf
	mov	x21, x0
	mov	w22, #0
	b	LBB0_10
LBB0_8:
	fdiv	s0, s10, 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	x22, x0
	fadd	s0, s9, s9
	fmul	s0, s0, s8
	bl	_roundf
	mov	x20, x0
LBB0_9:
	mov	w23, #0
LBB0_10:
	stp	w23, w22, [x19, #8]
LBB0_11:
	stp	w21, w20, [x19]
LBB0_12:
	mov	x0, x19
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	d9, d8, [sp, #16]               ; 16-byte Folded Reload
	ldp	d11, d10, [sp], #96             ; 16-byte Folded Reload
	b	_wiiu_set_projection
	.cfi_endproc
                                        ; -- End function
	.comm	_ASPECT_RATIO_CUSTOM,8,3        ; @ASPECT_RATIO_CUSTOM
	.no_dead_strip	_wiiu_gfx_update_viewport
.subsections_via_symbols
