Skip to content

Instantly share code, notes, and snippets.

@agam
Last active December 14, 2015 21:08
Show Gist options
  • Select an option

  • Save agam/5148398 to your computer and use it in GitHub Desktop.

Select an option

Save agam/5148398 to your computer and use it in GitHub Desktop.
Assembly output of Hello World in Haskell
.data
.align 8
.align 1
.globl __stginit_Main
.type __stginit_Main, @object
__stginit_Main:
.globl __stginit_ZCMain
.type __stginit_ZCMain, @object
__stginit_ZCMain:
.section .data
.align 8
.align 1
sfB_srt:
.quad ghczmprim_GHCziCString_unpackCStringzh_closure
.data
.align 8
.align 1
sfB_closure:
.quad sfB_info
.quad 0
.quad 0
.quad 0
.section .rodata
.align 8
.align 1
cfO_str:
.byte 72
.byte 101
.byte 108
.byte 108
.byte 111
.byte 32
.byte 87
.byte 111
.byte 114
.byte 108
.byte 100
.byte 0
.text
.align 8
.long sfB_srt-(sfB_info)+0
.long 0
.quad 0
.quad 4294967318
sfB_info:
.LcfS:
leaq -16(%rbp),%rax
cmpq %r15,%rax
jb .LcfU
addq $16,%r12
cmpq 144(%r13),%r12
ja .LcfW
movq $stg_CAF_BLACKHOLE_info,-8(%r12)
movq 160(%r13),%rax
movq %rax,0(%r12)
movq %r13,%rdi
movq %rbx,%rsi
leaq -8(%r12),%rdx
subq $8,%rsp
movl $0,%eax
call newCAF
addq $8,%rsp
testq %rax,%rax
je .LcfX
.LcfY:
movq $stg_bh_upd_frame_info,-16(%rbp)
leaq -8(%r12),%rax
movq %rax,-8(%rbp)
movl $ghczmprim_GHCziCString_unpackCStringzh_closure,%ebx
movl $cfO_str,%r14d
addq $-16,%rbp
jmp stg_ap_n_fast
.LcfW:
movq $16,192(%r13)
.LcfU:
jmp *-16(%r13)
.LcfX:
jmp *(%rbx)
.size sfB_info, .-sfB_info
.section .data
.align 8
.align 1
Main_main_srt:
.quad base_SystemziIO_putStrLn_closure
.quad sfB_closure
.data
.align 8
.align 1
.globl Main_main_closure
.type Main_main_closure, @object
Main_main_closure:
.quad Main_main_info
.quad 0
.quad 0
.quad 0
.text
.align 8
.long Main_main_srt-(Main_main_info)+0
.long 0
.quad 0
.quad 12884901910
.globl Main_main_info
.type Main_main_info, @object
Main_main_info:
.Lcgf:
leaq -16(%rbp),%rax
cmpq %r15,%rax
jb .Lcgh
addq $16,%r12
cmpq 144(%r13),%r12
ja .Lcgj
movq $stg_CAF_BLACKHOLE_info,-8(%r12)
movq 160(%r13),%rax
movq %rax,0(%r12)
movq %r13,%rdi
movq %rbx,%rsi
leaq -8(%r12),%rdx
subq $8,%rsp
movl $0,%eax
call newCAF
addq $8,%rsp
testq %rax,%rax
je .Lcgk
.Lcgl:
movq $stg_bh_upd_frame_info,-16(%rbp)
leaq -8(%r12),%rax
movq %rax,-8(%rbp)
movl $base_SystemziIO_putStrLn_closure,%ebx
movl $sfB_closure,%r14d
addq $-16,%rbp
jmp stg_ap_p_fast
.Lcgj:
movq $16,192(%r13)
.Lcgh:
jmp *-16(%r13)
.Lcgk:
jmp *(%rbx)
.size Main_main_info, .-Main_main_info
.section .data
.align 8
.align 1
ZCMain_main_srt:
.quad base_GHCziTopHandler_runMainIO_closure
.quad Main_main_closure
.data
.align 8
.align 1
.globl ZCMain_main_closure
.type ZCMain_main_closure, @object
ZCMain_main_closure:
.quad ZCMain_main_info
.quad 0
.quad 0
.quad 0
.text
.align 8
.long ZCMain_main_srt-(ZCMain_main_info)+0
.long 0
.quad 0
.quad 12884901910
.globl ZCMain_main_info
.type ZCMain_main_info, @object
ZCMain_main_info:
.LcgC:
leaq -16(%rbp),%rax
cmpq %r15,%rax
jb .LcgE
addq $16,%r12
cmpq 144(%r13),%r12
ja .LcgG
movq $stg_CAF_BLACKHOLE_info,-8(%r12)
movq 160(%r13),%rax
movq %rax,0(%r12)
movq %r13,%rdi
movq %rbx,%rsi
leaq -8(%r12),%rdx
subq $8,%rsp
movl $0,%eax
call newCAF
addq $8,%rsp
testq %rax,%rax
je .LcgH
.LcgI:
movq $stg_bh_upd_frame_info,-16(%rbp)
leaq -8(%r12),%rax
movq %rax,-8(%rbp)
movl $base_GHCziTopHandler_runMainIO_closure,%ebx
movl $Main_main_closure,%r14d
addq $-16,%rbp
jmp stg_ap_p_fast
.LcgG:
movq $16,192(%r13)
.LcgE:
jmp *-16(%r13)
.LcgH:
jmp *(%rbx)
.size ZCMain_main_info, .-ZCMain_main_info
.section .note.GNU-stack,"",@progbits
.ident "GHC 7.4.1"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment