	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function s390_iommu_attach_device
_s390_iommu_attach_device:              ## @s390_iommu_attach_device
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %rbx
	movq	%rdi, %r12
	callq	_to_s390_domain
	movq	%rax, %r14
	movq	%rbx, %rdi
	callq	_to_pci_dev
	movq	(%rax), %r13
	testq	%r13, %r13
	je	LBB0_1
## %bb.3:
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$16, %edi
	callq	_kzalloc
	testq	%rax, %rax
	je	LBB0_4
## %bb.5:
	movq	%rax, %r15
	cmpq	$0, 24(%r13)
	je	LBB0_7
## %bb.6:
	movq	%r13, %rdi
	callq	_zpci_dma_exit_device
LBB0_7:
	movq	8(%r14), %r8
	movq	%r8, 24(%r13)
	movq	(%r13), %rdx
	movq	8(%r13), %rcx
	movq	%r13, %rdi
	xorl	%esi, %esi
                                        ## kill: def $r8d killed $r8d killed $r8
	callq	_zpci_register_ioat
	movl	%eax, %ebx
	testl	%eax, %eax
	je	LBB0_8
LBB0_14:
	movq	%r13, %rdi
	callq	_zpci_dma_init_device
	movq	%r15, %rdi
	callq	_kfree
	jmp	LBB0_15
LBB0_1:
	movq	_ENODEV@GOTPCREL(%rip), %rax
	jmp	LBB0_2
LBB0_4:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
LBB0_2:
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_15:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	movq	%r14, %rdi
	callq	_spin_lock_irqsave
	movq	%r14, %rbx
	addq	$4, %rbx
	movq	%rbx, %rdi
	callq	_list_empty
	testq	%rax, %rax
	je	LBB0_11
## %bb.9:
	movups	(%r13), %xmm0
	movups	%xmm0, (%r12)
	movl	$1, 16(%r12)
LBB0_10:
	movq	%r13, 8(%r15)
	movq	%r14, 16(%r13)
	movq	%r15, %rdi
	movq	%rbx, %rsi
	callq	_list_add
	movq	%r14, %rdi
	callq	_spin_unlock_irqrestore
	xorl	%ebx, %ebx
	jmp	LBB0_15
LBB0_11:
	movq	(%r12), %rax
	cmpq	(%r13), %rax
	jne	LBB0_13
## %bb.12:
	movq	8(%r12), %rax
	cmpq	8(%r13), %rax
	je	LBB0_10
LBB0_13:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	movq	%r14, %rdi
	callq	_spin_unlock_irqrestore
	jmp	LBB0_14
	.cfi_endproc
                                        ## -- End function
	.comm	_ENODEV,4,2                     ## @ENODEV
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_EINVAL,4,2                     ## @EINVAL
	.no_dead_strip	_s390_iommu_attach_device
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function s390_iommu_attach_device
_s390_iommu_attach_device:              ; @s390_iommu_attach_device
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x20, x1
	mov	x22, x0
	bl	_to_s390_domain
	mov	x19, x0
	mov	x0, x20
	bl	_to_pci_dev
	ldr	x20, [x0]
	cbz	x20, LBB0_6
; %bb.1:
Lloh0:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	w0, #16
	bl	_kzalloc
	cbz	x0, LBB0_7
; %bb.2:
	mov	x21, x0
	ldr	x8, [x20, #24]
	cbz	x8, LBB0_4
; %bb.3:
	mov	x0, x20
	bl	_zpci_dma_exit_device
LBB0_4:
	ldr	x4, [x19, #8]
	str	x4, [x20, #24]
	ldp	x2, x3, [x20]
	mov	x0, x20
	mov	w1, #0
                                        ; kill: def $w4 killed $w4 killed $x4
	bl	_zpci_register_ioat
	mov	x23, x0
	cbz	w0, LBB0_10
LBB0_5:
	mov	x0, x20
	bl	_zpci_dma_init_device
	mov	x0, x21
	bl	_kfree
	b	LBB0_9
LBB0_6:
Lloh3:
	adrp	x8, _ENODEV@GOTPAGE
Lloh4:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
	b	LBB0_8
LBB0_7:
Lloh5:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh6:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
LBB0_8:
	ldr	w8, [x8]
	neg	w23, w8
LBB0_9:
	mov	x0, x23
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
LBB0_10:
	mov	x0, x19
	bl	_spin_lock_irqsave
	add	x23, x19, #4
	mov	x0, x23
	bl	_list_empty
	cbz	x0, LBB0_13
; %bb.11:
	ldr	q0, [x20]
	str	q0, [x22]
	mov	w8, #1
	str	w8, [x22, #16]
LBB0_12:
	str	x20, [x21, #8]
	str	x19, [x20, #16]
	mov	x0, x21
	mov	x1, x23
	bl	_list_add
	mov	x0, x19
	bl	_spin_unlock_irqrestore
	mov	w23, #0
	b	LBB0_9
LBB0_13:
	ldr	x8, [x22]
	ldr	x9, [x20]
	cmp	x8, x9
	b.ne	LBB0_15
; %bb.14:
	ldr	x8, [x22, #8]
	ldr	x9, [x20, #8]
	cmp	x8, x9
	b.eq	LBB0_12
LBB0_15:
Lloh7:
	adrp	x8, _EINVAL@GOTPAGE
Lloh8:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh9:
	ldr	w8, [x8]
	neg	w23, w8
	mov	x0, x19
	bl	_spin_unlock_irqrestore
	b	LBB0_5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.comm	_ENODEV,4,2                     ; @ENODEV
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_EINVAL,4,2                     ; @EINVAL
	.no_dead_strip	_s390_iommu_attach_device
.subsections_via_symbols
