	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal4,4byte_literals
	.p2align	2                               ## -- Begin function d3d8_set_viewport
LCPI0_0:
	.long	0x3f800000                      ## float 1
	.section	__TEXT,__literal8,8byte_literals
	.p2align	3
LCPI0_1:
	.quad	0x3fe0000000000000              ## double 0.5
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	4, 0x90
_d3d8_set_viewport:                     ## @d3d8_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	%rbx
	subq	$56, %rsp
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%ecx, %r9d
	movq	%rdi, %rbx
	movl	%esi, -40(%rbp)
	movl	%edx, -36(%rbp)
	movl	$0, -32(%rbp)
	movl	$0, -28(%rbp)
	movl	%r8d, (%rsp)
	leaq	-40(%rbp), %rsi
	leaq	-36(%rbp), %rdx
	leaq	-32(%rbp), %rcx
	leaq	-28(%rbp), %r8
	callq	_d3d8_calculate_rect
	movl	-32(%rbp), %eax
	testl	%eax, %eax
	jns	LBB0_2
## %bb.1:
	movl	$0, -32(%rbp)
	xorl	%eax, %eax
LBB0_2:
	movl	-28(%rbp), %ecx
	testl	%ecx, %ecx
	jns	LBB0_4
## %bb.3:
	movl	$0, -28(%rbp)
	xorl	%ecx, %ecx
LBB0_4:
	movl	%eax, 16(%rbx)
	movl	%ecx, 20(%rbx)
	movl	-40(%rbp), %eax
	movl	%eax, 24(%rbx)
	movl	-36(%rbp), %eax
	movl	%eax, 28(%rbx)
	movq	$0, 32(%rbx)
	leaq	-64(%rbp), %r14
	movss	LCPI0_0(%rip), %xmm1            ## xmm1 = mem[0],zero,zero,zero
	xorps	%xmm0, %xmm0
	movq	%r14, %rdi
	xorl	%esi, %esi
	movl	$1, %edx
	xorl	%ecx, %ecx
	movl	$1, %r8d
	callq	_d3d_matrix_ortho_off_center_lh
	leaq	-56(%rbp), %r15
	movq	%r15, %rdi
	callq	_d3d_matrix_identity
	movq	_M_PI@GOTPCREL(%rip), %rax
	movsd	(%rax), %xmm0                   ## xmm0 = mem[0],zero
	mulsd	LCPI0_1(%rip), %xmm0
	mulsd	(%rbx), %xmm0
	movq	%r15, %rdi
	callq	_d3d_matrix_rotation_z
	leaq	-72(%rbp), %rdi
	movq	%r14, %rsi
	movq	%r15, %rdx
	callq	_d3d_matrix_multiply
	leaq	12(%rbx), %rdi
	movq	%r14, %rsi
	callq	_d3d_matrix_transpose
	addq	$8, %rbx
	leaq	-48(%rbp), %rsi
	movq	%rbx, %rdi
	callq	_d3d_matrix_transpose
	addq	$56, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_M_PI,8,3                       ## @M_PI
	.no_dead_strip	_d3d8_set_viewport
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function d3d8_set_viewport
_d3d8_set_viewport:                     ; @d3d8_set_viewport
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x6, x4
	mov	x5, x3
	mov	x19, x0
	stp	w2, w1, [x29, #-24]
	str	xzr, [sp]
	sub	x1, x29, #20
	sub	x2, x29, #24
	add	x3, sp, #4
	mov	x4, sp
	bl	_d3d8_calculate_rect
	ldr	w8, [sp, #4]
	tbnz	w8, #31, LBB0_3
; %bb.1:
	ldr	w9, [sp]
	tbnz	w9, #31, LBB0_4
LBB0_2:
	stp	w8, w9, [x19, #16]
	ldp	w9, w8, [x29, #-24]
	stp	w8, w9, [x19, #24]
	str	xzr, [x19, #32]
	add	x0, sp, #24
	movi	d0, #0000000000000000
	fmov	s1, #1.00000000
	mov	w1, #0
	mov	w2, #1
	mov	w3, #0
	mov	w4, #1
	bl	_d3d_matrix_ortho_off_center_lh
	add	x0, sp, #16
	bl	_d3d_matrix_identity
	ldr	d0, [x19]
Lloh0:
	adrp	x8, _M_PI@GOTPAGE
Lloh1:
	ldr	x8, [x8, _M_PI@GOTPAGEOFF]
Lloh2:
	ldr	d1, [x8]
	fmov	d2, #0.50000000
	fmul	d1, d1, d2
	fmul	d0, d0, d1
	add	x0, sp, #16
	bl	_d3d_matrix_rotation_z
	add	x0, sp, #32
	add	x1, sp, #24
	add	x2, sp, #16
	bl	_d3d_matrix_multiply
	add	x0, x19, #12
	add	x1, sp, #24
	bl	_d3d_matrix_transpose
	add	x0, x19, #8
	add	x1, sp, #8
	bl	_d3d_matrix_transpose
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
LBB0_3:
	mov	w8, #0
	str	wzr, [sp, #4]
	ldr	w9, [sp]
	tbz	w9, #31, LBB0_2
LBB0_4:
	mov	w9, #0
	str	wzr, [sp]
	b	LBB0_2
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_M_PI,8,3                       ; @M_PI
	.no_dead_strip	_d3d8_set_viewport
.subsections_via_symbols
