filename
stringlengths
12
122
conversations
listlengths
2
2
extr_m68kopac.c_m68k_op_addi_32_ix.c
[ { "content": "You are given an x86 assembly block (<block>) to traspile into armv8_64 assembly.\nYou are also given the context for this block in the form of pre-context (<pre_context>) and post-context (<post_context>).\nThere is also a pre-target-context (<pre_target>) which is the context for the target block. Use the input pre and post context along with the target pre context to transpile the block from x86 to armv8_64.\n\n```x86asm\n; <pre-context>\n\tmovq\t%rax, -16(%rbp)\n\tmovq\t-16(%rbp), %rdi\n\tcallq\tm68ki_read_32@PLT\n\tmovq\t%rax, -24(%rbp)\n\tmovq\t-8(%rbp), %rax\n\n; <block>\n\taddq\t-24(%rbp), %rax\n\tmovq\t%rax, -32(%rbp)\n\tmovq\t-32(%rbp), %rdi\n\tcallq\tNFLAG_32@PLT\n\tmovl\t%eax, FLAG_N(%rip)\n\tmovq\t-8(%rbp), %rdi\n\tmovq\t-24(%rbp), %rsi\n\tmovq\t-32(%rbp), %rdx\n\tcallq\tVFLAG_ADD_32@PLT\n\tmovl\t%eax, FLAG_V(%rip)\n\n; <post-context>\n\tmovq\t-8(%rbp), %rdi\n\tmovq\t-24(%rbp), %rsi\n\tmovq\t-32(%rbp), %rdx\n\tcallq\tCFLAG_ADD_32@PLT\n\tmovl\t%eax, FLAG_C(%rip)\n\n```\n\n```armasm\n; <pre-target>\n\t.cfi_startproc\n; %bb.0:\n\tsub\tsp, sp, #48\n\t.cfi_def_cfa_offset 48\n\tstp\tx29, x30, [sp, #32] ; 16-byte Folded Spill\n\tadd\tx29, sp, #32\n\t.cfi_def_cfa w29, 16\n\t.cfi_offset w30, -8\n\t.cfi_offset w29, -16\n\tbl\t_OPER_I_32\n\tstur\tx0, [x29, #-8]\n\tbl\t_EA_AY_IX_32\n\tstr\tx0, [sp, #16]\n\tldr\tx0, [sp, #16]\n\tbl\t_m68ki_read_32\n\tstr\tx0, [sp, #8]\n\tldur\tx8, [x29, #-8]\n\tldr\tx9, [sp, #8]\n\n```", "role": "user" }, { "content": "```armasm\n\tadd\tx8, x8, x9\n\tstr\tx8, [sp]\n\tldr\tx0, [sp]\n\tbl\t_NFLAG_32\n\tadrp\tx8, _FLAG_N@GOTPAGE\n\tldr\tx8, [x8, _FLAG_N@GOTPAGEOFF]\n\tstr\tw0, [x8]\n\tldur\tx0, [x29, #-8]\n\tldr\tx1, [sp, #8]\n\tldr\tx2, [sp]\n\tbl\t_VFLAG_ADD_32\n\tadrp\tx8, _FLAG_V@GOTPAGE\n\tldr\tx8, [x8, _FLAG_V@GOTPAGEOFF]\n\tstr\tw0, [x8]\n```", "role": "assistant" } ]
extr_m68kopac.c_m68k_op_addi_32_ix.c
[ { "content": "You are given an x86 assembly block (<block>) to traspile into armv8_64 assembly.\nYou are also given the context for this block in the form of pre-context (<pre_context>) and post-context (<post_context>).\nThere is also a pre-target-context (<pre_target>) which is the context for the target block. Use the input pre and post context along with the target pre context to transpile the block from x86 to armv8_64.\n\n```x86asm\n; <pre-context>\n\tmovq\t-8(%rbp), %rdi\n\tmovq\t-24(%rbp), %rsi\n\tmovq\t-32(%rbp), %rdx\n\tcallq\tVFLAG_ADD_32@PLT\n\tmovl\t%eax, FLAG_V(%rip)\n\n; <block>\n\tmovq\t-8(%rbp), %rdi\n\tmovq\t-24(%rbp), %rsi\n\tmovq\t-32(%rbp), %rdx\n\tcallq\tCFLAG_ADD_32@PLT\n\tmovl\t%eax, FLAG_C(%rip)\n\tmovl\t%eax, FLAG_X(%rip)\n\tmovq\t-32(%rbp), %rdi\n\tcallq\tMASK_OUT_ABOVE_32@PLT\n\tmovl\t%eax, FLAG_Z(%rip)\n\tmovq\t-16(%rbp), %rdi\n\n; <post-context>\n\tmovl\tFLAG_Z(%rip), %esi\n\tcallq\tm68ki_write_32@PLT\n\taddq\t$32, %rsp\n\tpopq\t%rbp\n\t.cfi_def_cfa %rsp, 8\n\tretq\n.Lfunc_end0:\n\t.size\tm68k_op_addi_32_ix, .Lfunc_end0-m68k_op_addi_32_ix\n\t.cfi_endproc\n # -- End function\n\t.type\tFLAG_N,@object # @FLAG_N\n\t.bss\n\t.globl\tFLAG_N\n\t.p2align\t2, 0x0\nFLAG_N:\n\t.long\t0 # 0x0\n\t.size\tFLAG_N, 4\n\n\t.type\tFLAG_V,@object # @FLAG_V\n\t.globl\tFLAG_V\n\t.p2align\t2, 0x0\nFLAG_V:\n\t.long\t0 # 0x0\n\t.size\tFLAG_V, 4\n\n\t.type\tFLAG_C,@object # @FLAG_C\n\t.globl\tFLAG_C\n\t.p2align\t2, 0x0\nFLAG_C:\n\t.long\t0 # 0x0\n\t.size\tFLAG_C, 4\n\n\t.type\tFLAG_X,@object # @FLAG_X\n\t.globl\tFLAG_X\n\t.p2align\t2, 0x0\nFLAG_X:\n\t.long\t0 # 0x0\n\t.size\tFLAG_X, 4\n\n\t.type\tFLAG_Z,@object # @FLAG_Z\n\t.globl\tFLAG_Z\n\t.p2align\t2, 0x0\nFLAG_Z:\n\t.long\t0 # 0x0\n\t.size\tFLAG_Z, 4\n\n\t.ident\t\"Ubuntu clang version 18.1.3 (1ubuntu1)\"\n\t.section\t\".note.GNU-stack\",\"\",@progbits\n\t.addrsig\n\t.addrsig_sym OPER_I_32\n\t.addrsig_sym EA_AY_IX_32\n\t.addrsig_sym m68ki_read_32\n\t.addrsig_sym NFLAG_32\n\t.addrsig_sym VFLAG_ADD_32\n\t.addrsig_sym CFLAG_ADD_32\n\t.addrsig_sym MASK_OUT_ABOVE_32\n\t.addrsig_sym m68ki_write_32\n\t.addrsig_sym FLAG_N\n\t.addrsig_sym FLAG_V\n\t.addrsig_sym FLAG_C\n\t.addrsig_sym FLAG_X\n\t.addrsig_sym FLAG_Z\n\n```\n\n```armasm\n; <pre-target>\n\t.cfi_startproc\n; %bb.0:\n\tsub\tsp, sp, #48\n\t.cfi_def_cfa_offset 48\n\tstp\tx29, x30, [sp, #32] ; 16-byte Folded Spill\n\tadd\tx29, sp, #32\n\t.cfi_def_cfa w29, 16\n\t.cfi_offset w30, -8\n\t.cfi_offset w29, -16\n\tbl\t_OPER_I_32\n\tstur\tx0, [x29, #-8]\n\tbl\t_EA_AY_IX_32\n\tstr\tx0, [sp, #16]\n\tldr\tx0, [sp, #16]\n\tbl\t_m68ki_read_32\n\tstr\tx0, [sp, #8]\n\tldur\tx8, [x29, #-8]\n\tldr\tx9, [sp, #8]\n\tadd\tx8, x8, x9\n\tstr\tx8, [sp]\n\tldr\tx0, [sp]\n\tbl\t_NFLAG_32\n\tadrp\tx8, _FLAG_N@GOTPAGE\n\tldr\tx8, [x8, _FLAG_N@GOTPAGEOFF]\n\tstr\tw0, [x8]\n\tldur\tx0, [x29, #-8]\n\tldr\tx1, [sp, #8]\n\tldr\tx2, [sp]\n\tbl\t_VFLAG_ADD_32\n\tadrp\tx8, _FLAG_V@GOTPAGE\n\tldr\tx8, [x8, _FLAG_V@GOTPAGEOFF]\n\tstr\tw0, [x8]\n\n```", "role": "user" }, { "content": "```armasm\n\tldur\tx0, [x29, #-8]\n\tldr\tx1, [sp, #8]\n\tldr\tx2, [sp]\n\tbl\t_CFLAG_ADD_32\n\tadrp\tx8, _FLAG_C@GOTPAGE\n\tldr\tx8, [x8, _FLAG_C@GOTPAGEOFF]\n\tstr\tw0, [x8]\n\tadrp\tx8, _FLAG_X@GOTPAGE\n\tldr\tx8, [x8, _FLAG_X@GOTPAGEOFF]\n\tstr\tw0, [x8]\n\tldr\tx0, [sp]\n\tbl\t_MASK_OUT_ABOVE_32\n\tadrp\tx8, _FLAG_Z@GOTPAGE\n\tldr\tx8, [x8, _FLAG_Z@GOTPAGEOFF]\n\tstr\tw0, [x8]\n\tldr\tx0, [sp, #16]\n```", "role": "assistant" } ]
extr_m68kopac.c_m68k_op_addi_32_ix.c
[ { "content": "You are given an x86 assembly block (<block>) to traspile into armv8_64 assembly.\nYou are also given the context for this block in the form of pre-context (<pre_context>) and post-context (<post_context>).\nThere is also a pre-target-context (<pre_target>) which is the context for the target block. Use the input pre and post context along with the target pre context to transpile the block from x86 to armv8_64.\n\n```x86asm\n; <pre-context>\n\tmovl\t%eax, FLAG_X(%rip)\n\tmovq\t-32(%rbp), %rdi\n\tcallq\tMASK_OUT_ABOVE_32@PLT\n\tmovl\t%eax, FLAG_Z(%rip)\n\tmovq\t-16(%rbp), %rdi\n\n; <block>\n\tmovl\tFLAG_Z(%rip), %esi\n\tcallq\tm68ki_write_32@PLT\n\taddq\t$32, %rsp\n\tpopq\t%rbp\n\t.cfi_def_cfa %rsp, 8\n\tretq\n.Lfunc_end0:\n\t.size\tm68k_op_addi_32_ix, .Lfunc_end0-m68k_op_addi_32_ix\n\t.cfi_endproc\n # -- End function\n\t.type\tFLAG_N,@object # @FLAG_N\n\t.bss\n\t.globl\tFLAG_N\n\t.p2align\t2, 0x0\nFLAG_N:\n\t.long\t0 # 0x0\n\t.size\tFLAG_N, 4\n\n\t.type\tFLAG_V,@object # @FLAG_V\n\t.globl\tFLAG_V\n\t.p2align\t2, 0x0\nFLAG_V:\n\t.long\t0 # 0x0\n\t.size\tFLAG_V, 4\n\n\t.type\tFLAG_C,@object # @FLAG_C\n\t.globl\tFLAG_C\n\t.p2align\t2, 0x0\nFLAG_C:\n\t.long\t0 # 0x0\n\t.size\tFLAG_C, 4\n\n\t.type\tFLAG_X,@object # @FLAG_X\n\t.globl\tFLAG_X\n\t.p2align\t2, 0x0\nFLAG_X:\n\t.long\t0 # 0x0\n\t.size\tFLAG_X, 4\n\n\t.type\tFLAG_Z,@object # @FLAG_Z\n\t.globl\tFLAG_Z\n\t.p2align\t2, 0x0\nFLAG_Z:\n\t.long\t0 # 0x0\n\t.size\tFLAG_Z, 4\n\n\t.ident\t\"Ubuntu clang version 18.1.3 (1ubuntu1)\"\n\t.section\t\".note.GNU-stack\",\"\",@progbits\n\t.addrsig\n\t.addrsig_sym OPER_I_32\n\t.addrsig_sym EA_AY_IX_32\n\t.addrsig_sym m68ki_read_32\n\t.addrsig_sym NFLAG_32\n\t.addrsig_sym VFLAG_ADD_32\n\t.addrsig_sym CFLAG_ADD_32\n\t.addrsig_sym MASK_OUT_ABOVE_32\n\t.addrsig_sym m68ki_write_32\n\t.addrsig_sym FLAG_N\n\t.addrsig_sym FLAG_V\n\t.addrsig_sym FLAG_C\n\t.addrsig_sym FLAG_X\n\t.addrsig_sym FLAG_Z\n\n; <post-context>\n\n```\n\n```armasm\n; <pre-target>\n\t.cfi_startproc\n; %bb.0:\n\tsub\tsp, sp, #48\n\t.cfi_def_cfa_offset 48\n\tstp\tx29, x30, [sp, #32] ; 16-byte Folded Spill\n\tadd\tx29, sp, #32\n\t.cfi_def_cfa w29, 16\n\t.cfi_offset w30, -8\n\t.cfi_offset w29, -16\n\tbl\t_OPER_I_32\n\tstur\tx0, [x29, #-8]\n\tbl\t_EA_AY_IX_32\n\tstr\tx0, [sp, #16]\n\tldr\tx0, [sp, #16]\n\tbl\t_m68ki_read_32\n\tstr\tx0, [sp, #8]\n\tldur\tx8, [x29, #-8]\n\tldr\tx9, [sp, #8]\n\tadd\tx8, x8, x9\n\tstr\tx8, [sp]\n\tldr\tx0, [sp]\n\tbl\t_NFLAG_32\n\tadrp\tx8, _FLAG_N@GOTPAGE\n\tldr\tx8, [x8, _FLAG_N@GOTPAGEOFF]\n\tstr\tw0, [x8]\n\tldur\tx0, [x29, #-8]\n\tldr\tx1, [sp, #8]\n\tldr\tx2, [sp]\n\tbl\t_VFLAG_ADD_32\n\tadrp\tx8, _FLAG_V@GOTPAGE\n\tldr\tx8, [x8, _FLAG_V@GOTPAGEOFF]\n\tstr\tw0, [x8]\n\tldur\tx0, [x29, #-8]\n\tldr\tx1, [sp, #8]\n\tldr\tx2, [sp]\n\tbl\t_CFLAG_ADD_32\n\tadrp\tx8, _FLAG_C@GOTPAGE\n\tldr\tx8, [x8, _FLAG_C@GOTPAGEOFF]\n\tstr\tw0, [x8]\n\tadrp\tx8, _FLAG_X@GOTPAGE\n\tldr\tx8, [x8, _FLAG_X@GOTPAGEOFF]\n\tstr\tw0, [x8]\n\tldr\tx0, [sp]\n\tbl\t_MASK_OUT_ABOVE_32\n\tadrp\tx8, _FLAG_Z@GOTPAGE\n\tldr\tx8, [x8, _FLAG_Z@GOTPAGEOFF]\n\tstr\tw0, [x8]\n\tldr\tx0, [sp, #16]\n\n```", "role": "user" }, { "content": "```armasm\n\tldr\tw1, [x8]\n\tbl\t_m68ki_write_32\n\tldp\tx29, x30, [sp, #32] ; 16-byte Folded Reload\n\tadd\tsp, sp, #48\n\tret\n\t.cfi_endproc\n ; -- End function\n\t.comm\t_FLAG_N,4,2 ; @FLAG_N\n\t.comm\t_FLAG_V,4,2 ; @FLAG_V\n\t.comm\t_FLAG_C,4,2 ; @FLAG_C\n\t.comm\t_FLAG_X,4,2 ; @FLAG_X\n\t.comm\t_FLAG_Z,4,2 ; @FLAG_Z\n.subsections_via_symbols\n```", "role": "assistant" } ]
extr_m68kops.h_m68k_op_lsl_32_s.c
[ { "content": "You are given an x86 assembly block (<block>) to traspile into armv8_64 assembly.\nYou are also given the context for this block in the form of pre-context (<pre_context>) and post-context (<post_context>).\nThere is also a pre-target-context (<pre_target>) which is the context for the target block. Use the input pre and post context along with the target pre context to transpile the block from x86 to armv8_64.\n\n```x86asm\n; <pre-context>\n\n; <block>\n\t.text\n\t.file\t\"extr_m68kops.h_m68k_op_lsl_32_s.c\"\n\t.p2align\t4, 0x90 # -- Begin function m68k_op_lsl_32_s\n\t.type\tm68k_op_lsl_32_s,@function\nm68k_op_lsl_32_s: # @m68k_op_lsl_32_s\n\t.cfi_startproc\n# %bb.0:\n\tpushq\t%rbp\n\t.cfi_def_cfa_offset 16\n\t.cfi_offset %rbp, -16\n\tmovq\t%rsp, %rbp\n\t.cfi_def_cfa_register %rbp\n\tsubq\t$32, %rsp\n\tleaq\tDY(%rip), %rax\n\tmovq\t%rax, -8(%rbp)\n\tmovl\tREG_IR(%rip), %eax\n\tsarl\t$9, %eax\n\tsubl\t$1, %eax\n\tandl\t$7, %eax\n\taddl\t$1, %eax\n\tmovl\t%eax, -12(%rbp)\n\tmovq\t-8(%rbp), %rax\n\n; <post-context>\n\tmovl\t(%rax), %eax\n\tmovl\t%eax, -16(%rbp)\n\tmovl\t-16(%rbp), %edi\n\tmovl\t-12(%rbp), %ecx\n # kill: def $cl killed $ecx\n\tshll\t%cl, %edi\n\n```\n\n```armasm\n; <pre-target>\n\n```", "role": "user" }, { "content": "```armasm\n\t.section\t__TEXT,__text,regular,pure_instructions\n\t.build_version macos, 13, 0\tsdk_version 13, 3\n\t.p2align\t2 ; -- Begin function m68k_op_lsl_32_s\n_m68k_op_lsl_32_s: ; @m68k_op_lsl_32_s\n\t.cfi_startproc\n; %bb.0:\n\tsub\tsp, sp, #48\n\t.cfi_def_cfa_offset 48\n\tstp\tx29, x30, [sp, #32] ; 16-byte Folded Spill\n\tadd\tx29, sp, #32\n\t.cfi_def_cfa w29, 16\n\t.cfi_offset w30, -8\n\t.cfi_offset w29, -16\n\tadrp\tx8, _DY@GOTPAGE\n\tldr\tx8, [x8, _DY@GOTPAGEOFF]\n\tstur\tx8, [x29, #-8]\n\tadrp\tx8, _REG_IR@GOTPAGE\n\tldr\tx8, [x8, _REG_IR@GOTPAGEOFF]\n\tldr\tw8, [x8]\n\tasr\tw8, w8, #9\n\tsubs\tw8, w8, #1\n\tand\tw8, w8, #0x7\n\tadd\tw8, w8, #1\n\tstur\tw8, [x29, #-12]\n\tldur\tx8, [x29, #-8]\n```", "role": "assistant" } ]
extr_m68kops.h_m68k_op_lsl_32_s.c
[ { "content": "You are given an x86 assembly block (<block>) to traspile into armv8_64 assembly.\nYou are also given the context for this block in the form of pre-context (<pre_context>) and post-context (<post_context>).\nThere is also a pre-target-context (<pre_target>) which is the context for the target block. Use the input pre and post context along with the target pre context to transpile the block from x86 to armv8_64.\n\n```x86asm\n; <pre-context>\n\tsubl\t$1, %eax\n\tandl\t$7, %eax\n\taddl\t$1, %eax\n\tmovl\t%eax, -12(%rbp)\n\tmovq\t-8(%rbp), %rax\n\n; <block>\n\tmovl\t(%rax), %eax\n\tmovl\t%eax, -16(%rbp)\n\tmovl\t-16(%rbp), %edi\n\tmovl\t-12(%rbp), %ecx\n # kill: def $cl killed $ecx\n\tshll\t%cl, %edi\n\tcallq\tMASK_OUT_ABOVE_32@PLT\n\tmovl\t%eax, -20(%rbp)\n\tcmpl\t$0, -12(%rbp)\n\tje\t.LBB0_2\n# %bb.1:\n\tmovl\t-12(%rbp), %edi\n\n; <post-context>\n\timull\tCYC_SHIFT(%rip), %edi\n\tcallq\tUSE_CYCLES@PLT\n.LBB0_2:\n\tmovl\t-20(%rbp), %ecx\n\tmovq\t-8(%rbp), %rax\n\tmovl\t%ecx, (%rax)\n\n```\n\n```armasm\n; <pre-target>\n\t.cfi_startproc\n; %bb.0:\n\tsub\tsp, sp, #48\n\t.cfi_def_cfa_offset 48\n\tstp\tx29, x30, [sp, #32] ; 16-byte Folded Spill\n\tadd\tx29, sp, #32\n\t.cfi_def_cfa w29, 16\n\t.cfi_offset w30, -8\n\t.cfi_offset w29, -16\n\tadrp\tx8, _DY@GOTPAGE\n\tldr\tx8, [x8, _DY@GOTPAGEOFF]\n\tstur\tx8, [x29, #-8]\n\tadrp\tx8, _REG_IR@GOTPAGE\n\tldr\tx8, [x8, _REG_IR@GOTPAGEOFF]\n\tldr\tw8, [x8]\n\tasr\tw8, w8, #9\n\tsubs\tw8, w8, #1\n\tand\tw8, w8, #0x7\n\tadd\tw8, w8, #1\n\tstur\tw8, [x29, #-12]\n\tldur\tx8, [x29, #-8]\n\n```", "role": "user" }, { "content": "```armasm\n\tldr\tw8, [x8]\n\tstr\tw8, [sp, #16]\n\tldr\tw8, [sp, #16]\n\tldur\tw9, [x29, #-12]\n\tlsl\tw0, w8, w9\n\tbl\t_MASK_OUT_ABOVE_32\n\tstr\tw0, [sp, #12]\n\tldur\tw8, [x29, #-12]\n\tsubs\tw8, w8, #0\n\tcset\tw8, eq\n\ttbnz\tw8, #0, LBB0_2\n\tb\tLBB0_1\nLBB0_1:\n\tldur\tw8, [x29, #-12]\n\tadrp\tx9, _CYC_SHIFT@GOTPAGE\n\tldr\tx9, [x9, _CYC_SHIFT@GOTPAGEOFF]\n\tldr\tw9, [x9]\n```", "role": "assistant" } ]
extr_m68kops.h_m68k_op_lsl_32_s.c
[ { "content": "You are given an x86 assembly block (<block>) to traspile into armv8_64 assembly.\nYou are also given the context for this block in the form of pre-context (<pre_context>) and post-context (<post_context>).\nThere is also a pre-target-context (<pre_target>) which is the context for the target block. Use the input pre and post context along with the target pre context to transpile the block from x86 to armv8_64.\n\n```x86asm\n; <pre-context>\n\tcallq\tMASK_OUT_ABOVE_32@PLT\n\tmovl\t%eax, -20(%rbp)\n\tcmpl\t$0, -12(%rbp)\n\tje\t.LBB0_2\n# %bb.1:\n\tmovl\t-12(%rbp), %edi\n\n; <block>\n\timull\tCYC_SHIFT(%rip), %edi\n\tcallq\tUSE_CYCLES@PLT\n.LBB0_2:\n\tmovl\t-20(%rbp), %ecx\n\tmovq\t-8(%rbp), %rax\n\tmovl\t%ecx, (%rax)\n\tmovl\t-20(%rbp), %edi\n\tcallq\tNFLAG_32@PLT\n\tmovl\t%eax, FLAG_N(%rip)\n\tmovl\t-20(%rbp), %eax\n\tmovl\t%eax, FLAG_Z(%rip)\n\n; <post-context>\n\tmovl\t-16(%rbp), %eax\n\tmovl\t$24, %ecx\n\tsubl\t-12(%rbp), %ecx\n # kill: def $cl killed $ecx\n\tsarl\t%cl, %eax\n\tmovl\t%eax, FLAG_C(%rip)\n\tmovl\t%eax, FLAG_X(%rip)\n\n```\n\n```armasm\n; <pre-target>\n\t.cfi_startproc\n; %bb.0:\n\tsub\tsp, sp, #48\n\t.cfi_def_cfa_offset 48\n\tstp\tx29, x30, [sp, #32] ; 16-byte Folded Spill\n\tadd\tx29, sp, #32\n\t.cfi_def_cfa w29, 16\n\t.cfi_offset w30, -8\n\t.cfi_offset w29, -16\n\tadrp\tx8, _DY@GOTPAGE\n\tldr\tx8, [x8, _DY@GOTPAGEOFF]\n\tstur\tx8, [x29, #-8]\n\tadrp\tx8, _REG_IR@GOTPAGE\n\tldr\tx8, [x8, _REG_IR@GOTPAGEOFF]\n\tldr\tw8, [x8]\n\tasr\tw8, w8, #9\n\tsubs\tw8, w8, #1\n\tand\tw8, w8, #0x7\n\tadd\tw8, w8, #1\n\tstur\tw8, [x29, #-12]\n\tldur\tx8, [x29, #-8]\n\tldr\tw8, [x8]\n\tstr\tw8, [sp, #16]\n\tldr\tw8, [sp, #16]\n\tldur\tw9, [x29, #-12]\n\tlsl\tw0, w8, w9\n\tbl\t_MASK_OUT_ABOVE_32\n\tstr\tw0, [sp, #12]\n\tldur\tw8, [x29, #-12]\n\tsubs\tw8, w8, #0\n\tcset\tw8, eq\n\ttbnz\tw8, #0, LBB0_2\n\tb\tLBB0_1\nLBB0_1:\n\tldur\tw8, [x29, #-12]\n\tadrp\tx9, _CYC_SHIFT@GOTPAGE\n\tldr\tx9, [x9, _CYC_SHIFT@GOTPAGEOFF]\n\tldr\tw9, [x9]\n\n```", "role": "user" }, { "content": "```armasm\n\tmul\tw0, w8, w9\n\tbl\t_USE_CYCLES\n\tb\tLBB0_2\nLBB0_2:\n\tldr\tw8, [sp, #12]\n\tldur\tx9, [x29, #-8]\n\tstr\tw8, [x9]\n\tldr\tw0, [sp, #12]\n\tbl\t_NFLAG_32\n\tadrp\tx8, _FLAG_N@GOTPAGE\n\tldr\tx8, [x8, _FLAG_N@GOTPAGEOFF]\n\tstr\tw0, [x8]\n\tldr\tw8, [sp, #12]\n\tadrp\tx9, _FLAG_Z@GOTPAGE\n\tldr\tx9, [x9, _FLAG_Z@GOTPAGEOFF]\n\tstr\tw8, [x9]\n```", "role": "assistant" } ]
extr_m68kops.h_m68k_op_lsl_32_s.c
[ { "content": "You are given an x86 assembly block (<block>) to traspile into armv8_64 assembly.\nYou are also given the context for this block in the form of pre-context (<pre_context>) and post-context (<post_context>).\nThere is also a pre-target-context (<pre_target>) which is the context for the target block. Use the input pre and post context along with the target pre context to transpile the block from x86 to armv8_64.\n\n```x86asm\n; <pre-context>\n\tmovl\t-20(%rbp), %edi\n\tcallq\tNFLAG_32@PLT\n\tmovl\t%eax, FLAG_N(%rip)\n\tmovl\t-20(%rbp), %eax\n\tmovl\t%eax, FLAG_Z(%rip)\n\n; <block>\n\tmovl\t-16(%rbp), %eax\n\tmovl\t$24, %ecx\n\tsubl\t-12(%rbp), %ecx\n # kill: def $cl killed $ecx\n\tsarl\t%cl, %eax\n\tmovl\t%eax, FLAG_C(%rip)\n\tmovl\t%eax, FLAG_X(%rip)\n\tmovl\tVFLAG_CLEAR(%rip), %eax\n\tmovl\t%eax, FLAG_V(%rip)\n\taddq\t$32, %rsp\n\tpopq\t%rbp\n\t.cfi_def_cfa %rsp, 8\n\tretq\n.Lfunc_end0:\n\t.size\tm68k_op_lsl_32_s, .Lfunc_end0-m68k_op_lsl_32_s\n\t.cfi_endproc\n # -- End function\n\t.type\tDY,@object # @DY\n\t.bss\n\t.globl\tDY\n\t.p2align\t2, 0x0\nDY:\n\t.long\t0 # 0x0\n\t.size\tDY, 4\n\n\t.type\tREG_IR,@object # @REG_IR\n\t.globl\tREG_IR\n\t.p2align\t2, 0x0\nREG_IR:\n\t.long\t0 # 0x0\n\t.size\tREG_IR, 4\n\n\t.type\tCYC_SHIFT,@object # @CYC_SHIFT\n\t.globl\tCYC_SHIFT\n\t.p2align\t2, 0x0\nCYC_SHIFT:\n\t.long\t0 # 0x0\n\t.size\tCYC_SHIFT, 4\n\n\t.type\tFLAG_N,@object # @FLAG_N\n\t.globl\tFLAG_N\n\t.p2align\t2, 0x0\nFLAG_N:\n\t.long\t0 # 0x0\n\t.size\tFLAG_N, 4\n\n\t.type\tFLAG_Z,@object # @FLAG_Z\n\t.globl\tFLAG_Z\n\t.p2align\t2, 0x0\nFLAG_Z:\n\t.long\t0 # 0x0\n\t.size\tFLAG_Z, 4\n\n\t.type\tFLAG_C,@object # @FLAG_C\n\t.globl\tFLAG_C\n\t.p2align\t2, 0x0\nFLAG_C:\n\t.long\t0 # 0x0\n\t.size\tFLAG_C, 4\n\n\t.type\tFLAG_X,@object # @FLAG_X\n\t.globl\tFLAG_X\n\t.p2align\t2, 0x0\nFLAG_X:\n\t.long\t0 # 0x0\n\t.size\tFLAG_X, 4\n\n\t.type\tVFLAG_CLEAR,@object # @VFLAG_CLEAR\n\t.globl\tVFLAG_CLEAR\n\t.p2align\t2, 0x0\nVFLAG_CLEAR:\n\t.long\t0 # 0x0\n\t.size\tVFLAG_CLEAR, 4\n\n\t.type\tFLAG_V,@object # @FLAG_V\n\t.globl\tFLAG_V\n\t.p2align\t2, 0x0\nFLAG_V:\n\t.long\t0 # 0x0\n\t.size\tFLAG_V, 4\n\n\t.ident\t\"Ubuntu clang version 18.1.3 (1ubuntu1)\"\n\t.section\t\".note.GNU-stack\",\"\",@progbits\n\t.addrsig\n\t.addrsig_sym m68k_op_lsl_32_s\n\t.addrsig_sym MASK_OUT_ABOVE_32\n\t.addrsig_sym USE_CYCLES\n\t.addrsig_sym NFLAG_32\n\t.addrsig_sym DY\n\t.addrsig_sym REG_IR\n\t.addrsig_sym CYC_SHIFT\n\t.addrsig_sym FLAG_N\n\t.addrsig_sym FLAG_Z\n\t.addrsig_sym FLAG_C\n\t.addrsig_sym FLAG_X\n\t.addrsig_sym VFLAG_CLEAR\n\t.addrsig_sym FLAG_V\n\n; <post-context>\n\n```\n\n```armasm\n; <pre-target>\n\t.cfi_startproc\n; %bb.0:\n\tsub\tsp, sp, #48\n\t.cfi_def_cfa_offset 48\n\tstp\tx29, x30, [sp, #32] ; 16-byte Folded Spill\n\tadd\tx29, sp, #32\n\t.cfi_def_cfa w29, 16\n\t.cfi_offset w30, -8\n\t.cfi_offset w29, -16\n\tadrp\tx8, _DY@GOTPAGE\n\tldr\tx8, [x8, _DY@GOTPAGEOFF]\n\tstur\tx8, [x29, #-8]\n\tadrp\tx8, _REG_IR@GOTPAGE\n\tldr\tx8, [x8, _REG_IR@GOTPAGEOFF]\n\tldr\tw8, [x8]\n\tasr\tw8, w8, #9\n\tsubs\tw8, w8, #1\n\tand\tw8, w8, #0x7\n\tadd\tw8, w8, #1\n\tstur\tw8, [x29, #-12]\n\tldur\tx8, [x29, #-8]\n\tldr\tw8, [x8]\n\tstr\tw8, [sp, #16]\n\tldr\tw8, [sp, #16]\n\tldur\tw9, [x29, #-12]\n\tlsl\tw0, w8, w9\n\tbl\t_MASK_OUT_ABOVE_32\n\tstr\tw0, [sp, #12]\n\tldur\tw8, [x29, #-12]\n\tsubs\tw8, w8, #0\n\tcset\tw8, eq\n\ttbnz\tw8, #0, LBB0_2\n\tb\tLBB0_1\nLBB0_1:\n\tldur\tw8, [x29, #-12]\n\tadrp\tx9, _CYC_SHIFT@GOTPAGE\n\tldr\tx9, [x9, _CYC_SHIFT@GOTPAGEOFF]\n\tldr\tw9, [x9]\n\tmul\tw0, w8, w9\n\tbl\t_USE_CYCLES\n\tb\tLBB0_2\nLBB0_2:\n\tldr\tw8, [sp, #12]\n\tldur\tx9, [x29, #-8]\n\tstr\tw8, [x9]\n\tldr\tw0, [sp, #12]\n\tbl\t_NFLAG_32\n\tadrp\tx8, _FLAG_N@GOTPAGE\n\tldr\tx8, [x8, _FLAG_N@GOTPAGEOFF]\n\tstr\tw0, [x8]\n\tldr\tw8, [sp, #12]\n\tadrp\tx9, _FLAG_Z@GOTPAGE\n\tldr\tx9, [x9, _FLAG_Z@GOTPAGEOFF]\n\tstr\tw8, [x9]\n\n```", "role": "user" }, { "content": "```armasm\n\tldr\tw8, [sp, #16]\n\tldur\tw10, [x29, #-12]\n\tmov\tw9, #24\n\tsubs\tw9, w9, w10\n\tasr\tw8, w8, w9\n\tadrp\tx9, _FLAG_C@GOTPAGE\n\tldr\tx9, [x9, _FLAG_C@GOTPAGEOFF]\n\tstr\tw8, [x9]\n\tadrp\tx9, _FLAG_X@GOTPAGE\n\tldr\tx9, [x9, _FLAG_X@GOTPAGEOFF]\n\tstr\tw8, [x9]\n\tadrp\tx8, _VFLAG_CLEAR@GOTPAGE\n\tldr\tx8, [x8, _VFLAG_CLEAR@GOTPAGEOFF]\n\tldr\tw8, [x8]\n\tadrp\tx9, _FLAG_V@GOTPAGE\n\tldr\tx9, [x9, _FLAG_V@GOTPAGEOFF]\n\tstr\tw8, [x9]\n\tldp\tx29, x30, [sp, #32] ; 16-byte Folded Reload\n\tadd\tsp, sp, #48\n\tret\n\t.cfi_endproc\n ; -- End function\n\t.comm\t_DY,4,2 ; @DY\n\t.comm\t_REG_IR,4,2 ; @REG_IR\n\t.comm\t_CYC_SHIFT,4,2 ; @CYC_SHIFT\n\t.comm\t_FLAG_N,4,2 ; @FLAG_N\n\t.comm\t_FLAG_Z,4,2 ; @FLAG_Z\n\t.comm\t_FLAG_C,4,2 ; @FLAG_C\n\t.comm\t_FLAG_X,4,2 ; @FLAG_X\n\t.comm\t_VFLAG_CLEAR,4,2 ; @VFLAG_CLEAR\n\t.comm\t_FLAG_V,4,2 ; @FLAG_V\n\t.no_dead_strip\t_m68k_op_lsl_32_s\n.subsections_via_symbols\n```", "role": "assistant" } ]
extr_switec.c_callback_free.c
[ { "content": "You are given an x86 assembly block (<block>) to traspile into armv8_64 assembly.\nYou are also given the context for this block in the form of pre-context (<pre_context>) and post-context (<post_context>).\nThere is also a pre-target-context (<pre_target>) which is the context for the target block. Use the input pre and post context along with the target pre context to transpile the block from x86 to armv8_64.\n\n```x86asm\n; <pre-context>\n\n; <block>\n\t.text\n\t.file\t\"extr_switec.c_callback_free.c\"\n\t.p2align\t4, 0x90 # -- Begin function callback_free\n\t.type\tcallback_free,@function\ncallback_free: # @callback_free\n\t.cfi_startproc\n# %bb.0:\n\tpushq\t%rbp\n\t.cfi_def_cfa_offset 16\n\t.cfi_offset %rbp, -16\n\tmovq\t%rsp, %rbp\n\t.cfi_def_cfa_register %rbp\n\tsubq\t$16, %rsp\n\tmovq\t%rdi, -8(%rbp)\n\tmovl\t%esi, -12(%rbp)\n\tmovq\t-8(%rbp), %rdi\n\tmovl\tLUA_REGISTRYINDEX(%rip), %esi\n\tmovq\tstopped_callback(%rip), %rax\n\tmovl\t-12(%rbp), %ecx\n # kill: def $rcx killed $ecx\n\tmovl\t(%rax,%rcx,4), %edx\n\tcallq\tluaL_unref@PLT\n\tmovl\tLUA_NOREF(%rip), %edx\n\tmovq\tstopped_callback(%rip), %rax\n\tmovl\t-12(%rbp), %ecx\n # kill: def $rcx killed $ecx\n\tmovl\t%edx, (%rax,%rcx,4)\n\taddq\t$16, %rsp\n\tpopq\t%rbp\n\t.cfi_def_cfa %rsp, 8\n\tretq\n.Lfunc_end0:\n\t.size\tcallback_free, .Lfunc_end0-callback_free\n\t.cfi_endproc\n # -- End function\n\t.type\tLUA_REGISTRYINDEX,@object # @LUA_REGISTRYINDEX\n\t.bss\n\t.globl\tLUA_REGISTRYINDEX\n\t.p2align\t2, 0x0\nLUA_REGISTRYINDEX:\n\t.long\t0 # 0x0\n\t.size\tLUA_REGISTRYINDEX, 4\n\n\t.type\tstopped_callback,@object # @stopped_callback\n\t.globl\tstopped_callback\n\t.p2align\t3, 0x0\nstopped_callback:\n\t.quad\t0\n\t.size\tstopped_callback, 8\n\n\t.type\tLUA_NOREF,@object # @LUA_NOREF\n\t.globl\tLUA_NOREF\n\t.p2align\t2, 0x0\nLUA_NOREF:\n\t.long\t0 # 0x0\n\t.size\tLUA_NOREF, 4\n\n\t.ident\t\"Ubuntu clang version 18.1.3 (1ubuntu1)\"\n\t.section\t\".note.GNU-stack\",\"\",@progbits\n\t.addrsig\n\t.addrsig_sym callback_free\n\t.addrsig_sym luaL_unref\n\t.addrsig_sym LUA_REGISTRYINDEX\n\t.addrsig_sym stopped_callback\n\t.addrsig_sym LUA_NOREF\n\n; <post-context>\n\n```\n\n```armasm\n; <pre-target>\n\n```", "role": "user" }, { "content": "```armasm\n\t.section\t__TEXT,__text,regular,pure_instructions\n\t.build_version macos, 13, 0\tsdk_version 13, 3\n\t.p2align\t2 ; -- Begin function callback_free\n_callback_free: ; @callback_free\n\t.cfi_startproc\n; %bb.0:\n\tsub\tsp, sp, #48\n\t.cfi_def_cfa_offset 48\n\tstp\tx29, x30, [sp, #32] ; 16-byte Folded Spill\n\tadd\tx29, sp, #32\n\t.cfi_def_cfa w29, 16\n\t.cfi_offset w30, -8\n\t.cfi_offset w29, -16\n\tstur\tx0, [x29, #-8]\n\tstur\tw1, [x29, #-12]\n\tldur\tx0, [x29, #-8]\n\tadrp\tx8, _LUA_REGISTRYINDEX@GOTPAGE\n\tldr\tx8, [x8, _LUA_REGISTRYINDEX@GOTPAGEOFF]\n\tldr\tw1, [x8]\n\tadrp\tx8, _stopped_callback@GOTPAGE\n\tldr\tx8, [x8, _stopped_callback@GOTPAGEOFF]\n\tstr\tx8, [sp, #8] ; 8-byte Folded Spill\n\tldr\tx8, [x8]\n\tldur\tw9, [x29, #-12]\n ; kill: def $x9 killed $w9\n\tldr\tw2, [x8, x9, lsl #2]\n\tbl\t_luaL_unref\n\tldr\tx9, [sp, #8] ; 8-byte Folded Reload\n\tadrp\tx8, _LUA_NOREF@GOTPAGE\n\tldr\tx8, [x8, _LUA_NOREF@GOTPAGEOFF]\n\tldr\tw8, [x8]\n\tldr\tx9, [x9]\n\tldur\tw10, [x29, #-12]\n ; kill: def $x10 killed $w10\n\tstr\tw8, [x9, x10, lsl #2]\n\tldp\tx29, x30, [sp, #32] ; 16-byte Folded Reload\n\tadd\tsp, sp, #48\n\tret\n\t.cfi_endproc\n ; -- End function\n\t.comm\t_LUA_REGISTRYINDEX,4,2 ; @LUA_REGISTRYINDEX\n\t.comm\t_stopped_callback,8,3 ; @stopped_callback\n\t.comm\t_LUA_NOREF,4,2 ; @LUA_NOREF\n\t.no_dead_strip\t_callback_free\n.subsections_via_symbols\n```", "role": "assistant" } ]
extr_ac97_patch.c_patch_sigmatel_stac9708.c
[ { "content": "You are given an x86 assembly block (<block>) to traspile into armv8_64 assembly.\nYou are also given the context for this block in the form of pre-context (<pre_context>) and post-context (<post_context>).\nThere is also a pre-target-context (<pre_target>) which is the context for the target block. Use the input pre and post context along with the target pre context to transpile the block from x86 to armv8_64.\n\n```x86asm\n; <pre-context>\n\n; <block>\n\t.text\n\t.file\t\"extr_ac97_patch.c_patch_sigmatel_stac9708.c\"\n\t.p2align\t4, 0x90 # -- Begin function patch_sigmatel_stac9708\n\t.type\tpatch_sigmatel_stac9708,@function\npatch_sigmatel_stac9708: # @patch_sigmatel_stac9708\n\t.cfi_startproc\n# %bb.0:\n\tpushq\t%rbp\n\t.cfi_def_cfa_offset 16\n\t.cfi_offset %rbp, -16\n\tmovq\t%rsp, %rbp\n\t.cfi_def_cfa_register %rbp\n\tsubq\t$16, %rsp\n\tmovq\t%rdi, -8(%rbp)\n\tmovq\t-8(%rbp), %rax\n\tleaq\tpatch_sigmatel_stac9708_ops(%rip), %rcx\n\tmovq\t%rcx, 8(%rax)\n\tmovq\t-8(%rbp), %rax\n\tmovl\t(%rax), %ecx\n\torl\t$16, %ecx\n\tmovl\t%ecx, (%rax)\n\tmovq\t-8(%rbp), %rdi\n\tmovl\tAC97_SIGMATEL_BIAS2(%rip), %esi\n\tcallq\tsnd_ac97_read@PLT\n\tandl\t$32768, %eax # imm = 0x8000\n\n; <post-context>\n\tmovl\t%eax, -12(%rbp)\n\tmovq\t-8(%rbp), %rdi\n\tmovl\tAC97_SIGMATEL_ANALOG(%rip), %esi\n\tcallq\tsnd_ac97_read@PLT\n\tmovl\t%eax, -16(%rbp)\n\n```\n\n```armasm\n; <pre-target>\n\n```", "role": "user" }, { "content": "```armasm\n\t.section\t__TEXT,__text,regular,pure_instructions\n\t.build_version macos, 13, 0\tsdk_version 13, 3\n\t.p2align\t2 ; -- Begin function patch_sigmatel_stac9708\n_patch_sigmatel_stac9708: ; @patch_sigmatel_stac9708\n\t.cfi_startproc\n; %bb.0:\n\tsub\tsp, sp, #48\n\t.cfi_def_cfa_offset 48\n\tstp\tx29, x30, [sp, #32] ; 16-byte Folded Spill\n\tadd\tx29, sp, #32\n\t.cfi_def_cfa w29, 16\n\t.cfi_offset w30, -8\n\t.cfi_offset w29, -16\n\tstur\tx0, [x29, #-8]\n\tldur\tx9, [x29, #-8]\n\tadrp\tx8, _patch_sigmatel_stac9708_ops@GOTPAGE\n\tldr\tx8, [x8, _patch_sigmatel_stac9708_ops@GOTPAGEOFF]\n\tstr\tx8, [x9, #8]\n\tldur\tx9, [x29, #-8]\n\tldr\tw8, [x9]\n\torr\tw8, w8, #0x10\n\tstr\tw8, [x9]\n\tldur\tx0, [x29, #-8]\n\tadrp\tx8, _AC97_SIGMATEL_BIAS2@GOTPAGE\n\tldr\tx8, [x8, _AC97_SIGMATEL_BIAS2@GOTPAGEOFF]\n\tldr\tw1, [x8]\n\tbl\t_snd_ac97_read\n\tand\tw8, w0, #0x8000\n```", "role": "assistant" } ]
extr_ac97_patch.c_patch_sigmatel_stac9708.c
[ { "content": "You are given an x86 assembly block (<block>) to traspile into armv8_64 assembly.\nYou are also given the context for this block in the form of pre-context (<pre_context>) and post-context (<post_context>).\nThere is also a pre-target-context (<pre_target>) which is the context for the target block. Use the input pre and post context along with the target pre context to transpile the block from x86 to armv8_64.\n\n```x86asm\n; <pre-context>\n\tmovl\t(%rax), %ecx\n\torl\t$16, %ecx\n\tmovl\t%ecx, (%rax)\n\tmovq\t-8(%rbp), %rdi\n\tmovl\tAC97_SIGMATEL_BIAS2(%rip), %esi\n\tcallq\tsnd_ac97_read@PLT\n\tandl\t$32768, %eax # imm = 0x8000\n\n; <block>\n\tmovl\t%eax, -12(%rbp)\n\tmovq\t-8(%rbp), %rdi\n\tmovl\tAC97_SIGMATEL_ANALOG(%rip), %esi\n\tcallq\tsnd_ac97_read@PLT\n\tmovl\t%eax, -16(%rbp)\n\tcmpl\t$0, -12(%rbp)\n\tjne\t.LBB0_3\n# %bb.1:\n\tcmpl\t$0, -16(%rbp)\n\tjne\t.LBB0_3\n# %bb.2:\n\tmovq\t-8(%rbp), %rdi\n\n; <post-context>\n\tmovl\tAC97_SIGMATEL_CIC1(%rip), %esi\n\tmovl\t$43962, %edx # imm = 0xABBA\n\tcallq\tsnd_ac97_write_cache@PLT\n\tmovq\t-8(%rbp), %rdi\n\tmovl\tAC97_SIGMATEL_CIC2(%rip), %esi\n\tmovl\t$4096, %edx # imm = 0x1000\n\tcallq\tsnd_ac97_write_cache@PLT\n\n```\n\n```armasm\n; <pre-target>\n\t.cfi_startproc\n; %bb.0:\n\tsub\tsp, sp, #48\n\t.cfi_def_cfa_offset 48\n\tstp\tx29, x30, [sp, #32] ; 16-byte Folded Spill\n\tadd\tx29, sp, #32\n\t.cfi_def_cfa w29, 16\n\t.cfi_offset w30, -8\n\t.cfi_offset w29, -16\n\tstur\tx0, [x29, #-8]\n\tldur\tx9, [x29, #-8]\n\tadrp\tx8, _patch_sigmatel_stac9708_ops@GOTPAGE\n\tldr\tx8, [x8, _patch_sigmatel_stac9708_ops@GOTPAGEOFF]\n\tstr\tx8, [x9, #8]\n\tldur\tx9, [x29, #-8]\n\tldr\tw8, [x9]\n\torr\tw8, w8, #0x10\n\tstr\tw8, [x9]\n\tldur\tx0, [x29, #-8]\n\tadrp\tx8, _AC97_SIGMATEL_BIAS2@GOTPAGE\n\tldr\tx8, [x8, _AC97_SIGMATEL_BIAS2@GOTPAGEOFF]\n\tldr\tw1, [x8]\n\tbl\t_snd_ac97_read\n\tand\tw8, w0, #0x8000\n\n```", "role": "user" }, { "content": "```armasm\n\tstur\tw8, [x29, #-12]\n\tldur\tx0, [x29, #-8]\n\tadrp\tx8, _AC97_SIGMATEL_ANALOG@GOTPAGE\n\tldr\tx8, [x8, _AC97_SIGMATEL_ANALOG@GOTPAGEOFF]\n\tldr\tw1, [x8]\n\tbl\t_snd_ac97_read\n\tstr\tw0, [sp, #16]\n\tldur\tw8, [x29, #-12]\n\tsubs\tw8, w8, #0\n\tcset\tw8, ne\n\ttbnz\tw8, #0, LBB0_3\n\tb\tLBB0_1\nLBB0_1:\n\tldr\tw8, [sp, #16]\n\tsubs\tw8, w8, #0\n\tcset\tw8, ne\n\ttbnz\tw8, #0, LBB0_3\n\tb\tLBB0_2\nLBB0_2:\n\tldur\tx0, [x29, #-8]\n\tadrp\tx8, _AC97_SIGMATEL_CIC1@GOTPAGE\n\tldr\tx8, [x8, _AC97_SIGMATEL_CIC1@GOTPAGEOFF]\n```", "role": "assistant" } ]
extr_ac97_patch.c_patch_sigmatel_stac9708.c
[ { "content": "You are given an x86 assembly block (<block>) to traspile into armv8_64 assembly.\nYou are also given the context for this block in the form of pre-context (<pre_context>) and post-context (<post_context>).\nThere is also a pre-target-context (<pre_target>) which is the context for the target block. Use the input pre and post context along with the target pre context to transpile the block from x86 to armv8_64.\n\n```x86asm\n; <pre-context>\n\tcmpl\t$0, -12(%rbp)\n\tjne\t.LBB0_3\n# %bb.1:\n\tcmpl\t$0, -16(%rbp)\n\tjne\t.LBB0_3\n# %bb.2:\n\tmovq\t-8(%rbp), %rdi\n\n; <block>\n\tmovl\tAC97_SIGMATEL_CIC1(%rip), %esi\n\tmovl\t$43962, %edx # imm = 0xABBA\n\tcallq\tsnd_ac97_write_cache@PLT\n\tmovq\t-8(%rbp), %rdi\n\tmovl\tAC97_SIGMATEL_CIC2(%rip), %esi\n\tmovl\t$4096, %edx # imm = 0x1000\n\tcallq\tsnd_ac97_write_cache@PLT\n\tmovq\t-8(%rbp), %rdi\n\tmovl\tAC97_SIGMATEL_BIAS1(%rip), %esi\n\tmovl\t$43962, %edx # imm = 0xABBA\n\tcallq\tsnd_ac97_write_cache@PLT\n\tmovq\t-8(%rbp), %rdi\n\tmovl\tAC97_SIGMATEL_BIAS2(%rip), %esi\n\n; <post-context>\n\tmovl\t$7, %edx\n\tcallq\tsnd_ac97_write_cache@PLT\n\tjmp\t.LBB0_11\n.LBB0_3:\n\tcmpl\t$32768, -12(%rbp) # imm = 0x8000\n\tjne\t.LBB0_6\n# %bb.4:\n\tcmpl\t$0, -16(%rbp)\n\n```\n\n```armasm\n; <pre-target>\n\t.cfi_startproc\n; %bb.0:\n\tsub\tsp, sp, #48\n\t.cfi_def_cfa_offset 48\n\tstp\tx29, x30, [sp, #32] ; 16-byte Folded Spill\n\tadd\tx29, sp, #32\n\t.cfi_def_cfa w29, 16\n\t.cfi_offset w30, -8\n\t.cfi_offset w29, -16\n\tstur\tx0, [x29, #-8]\n\tldur\tx9, [x29, #-8]\n\tadrp\tx8, _patch_sigmatel_stac9708_ops@GOTPAGE\n\tldr\tx8, [x8, _patch_sigmatel_stac9708_ops@GOTPAGEOFF]\n\tstr\tx8, [x9, #8]\n\tldur\tx9, [x29, #-8]\n\tldr\tw8, [x9]\n\torr\tw8, w8, #0x10\n\tstr\tw8, [x9]\n\tldur\tx0, [x29, #-8]\n\tadrp\tx8, _AC97_SIGMATEL_BIAS2@GOTPAGE\n\tldr\tx8, [x8, _AC97_SIGMATEL_BIAS2@GOTPAGEOFF]\n\tldr\tw1, [x8]\n\tbl\t_snd_ac97_read\n\tand\tw8, w0, #0x8000\n\tstur\tw8, [x29, #-12]\n\tldur\tx0, [x29, #-8]\n\tadrp\tx8, _AC97_SIGMATEL_ANALOG@GOTPAGE\n\tldr\tx8, [x8, _AC97_SIGMATEL_ANALOG@GOTPAGEOFF]\n\tldr\tw1, [x8]\n\tbl\t_snd_ac97_read\n\tstr\tw0, [sp, #16]\n\tldur\tw8, [x29, #-12]\n\tsubs\tw8, w8, #0\n\tcset\tw8, ne\n\ttbnz\tw8, #0, LBB0_3\n\tb\tLBB0_1\nLBB0_1:\n\tldr\tw8, [sp, #16]\n\tsubs\tw8, w8, #0\n\tcset\tw8, ne\n\ttbnz\tw8, #0, LBB0_3\n\tb\tLBB0_2\nLBB0_2:\n\tldur\tx0, [x29, #-8]\n\tadrp\tx8, _AC97_SIGMATEL_CIC1@GOTPAGE\n\tldr\tx8, [x8, _AC97_SIGMATEL_CIC1@GOTPAGEOFF]\n\n```", "role": "user" }, { "content": "```armasm\n\tldr\tw1, [x8]\n\tmov\tw2, #43962\n\tstr\tw2, [sp, #12] ; 4-byte Folded Spill\n\tbl\t_snd_ac97_write_cache\n\tldur\tx0, [x29, #-8]\n\tadrp\tx8, _AC97_SIGMATEL_CIC2@GOTPAGE\n\tldr\tx8, [x8, _AC97_SIGMATEL_CIC2@GOTPAGEOFF]\n\tldr\tw1, [x8]\n\tmov\tw2, #4096\n\tbl\t_snd_ac97_write_cache\n\tldr\tw2, [sp, #12] ; 4-byte Folded Reload\n\tldur\tx0, [x29, #-8]\n\tadrp\tx8, _AC97_SIGMATEL_BIAS1@GOTPAGE\n\tldr\tx8, [x8, _AC97_SIGMATEL_BIAS1@GOTPAGEOFF]\n\tldr\tw1, [x8]\n\tbl\t_snd_ac97_write_cache\n\tldur\tx0, [x29, #-8]\n\tadrp\tx8, _AC97_SIGMATEL_BIAS2@GOTPAGE\n\tldr\tx8, [x8, _AC97_SIGMATEL_BIAS2@GOTPAGEOFF]\n\tldr\tw1, [x8]\n\tmov\tw2, #7\n```", "role": "assistant" } ]
extr_ac97_patch.c_patch_sigmatel_stac9708.c
[ { "content": "You are given an x86 assembly block (<block>) to traspile into armv8_64 assembly.\nYou are also given the context for this block in the form of pre-context (<pre_context>) and post-context (<post_context>).\nThere is also a pre-target-context (<pre_target>) which is the context for the target block. Use the input pre and post context along with the target pre context to transpile the block from x86 to armv8_64.\n\n```x86asm\n; <pre-context>\n\tmovq\t-8(%rbp), %rdi\n\tmovl\tAC97_SIGMATEL_BIAS1(%rip), %esi\n\tmovl\t$43962, %edx # imm = 0xABBA\n\tcallq\tsnd_ac97_write_cache@PLT\n\tmovq\t-8(%rbp), %rdi\n\tmovl\tAC97_SIGMATEL_BIAS2(%rip), %esi\n\n; <block>\n\tmovl\t$7, %edx\n\tcallq\tsnd_ac97_write_cache@PLT\n\tjmp\t.LBB0_11\n.LBB0_3:\n\tcmpl\t$32768, -12(%rbp) # imm = 0x8000\n\tjne\t.LBB0_6\n# %bb.4:\n\tcmpl\t$0, -16(%rbp)\n\tjne\t.LBB0_6\n# %bb.5:\n\tmovq\t-8(%rbp), %rdi\n\tmovl\tAC97_SIGMATEL_CIC1(%rip), %esi\n\tmovl\t$43962, %edx # imm = 0xABBA\n\tcallq\tsnd_ac97_write_cache@PLT\n\tmovq\t-8(%rbp), %rdi\n\n; <post-context>\n\tmovl\tAC97_SIGMATEL_CIC2(%rip), %esi\n\tmovl\t$4097, %edx # imm = 0x1001\n\tcallq\tsnd_ac97_write_cache@PLT\n\tmovq\t-8(%rbp), %rdi\n\tmovl\tAC97_SIGMATEL_DAC2INVERT(%rip), %esi\n\tmovl\t$8, %edx\n\tcallq\tsnd_ac97_write_cache@PLT\n\n```\n\n```armasm\n; <pre-target>\n\t.cfi_startproc\n; %bb.0:\n\tsub\tsp, sp, #48\n\t.cfi_def_cfa_offset 48\n\tstp\tx29, x30, [sp, #32] ; 16-byte Folded Spill\n\tadd\tx29, sp, #32\n\t.cfi_def_cfa w29, 16\n\t.cfi_offset w30, -8\n\t.cfi_offset w29, -16\n\tstur\tx0, [x29, #-8]\n\tldur\tx9, [x29, #-8]\n\tadrp\tx8, _patch_sigmatel_stac9708_ops@GOTPAGE\n\tldr\tx8, [x8, _patch_sigmatel_stac9708_ops@GOTPAGEOFF]\n\tstr\tx8, [x9, #8]\n\tldur\tx9, [x29, #-8]\n\tldr\tw8, [x9]\n\torr\tw8, w8, #0x10\n\tstr\tw8, [x9]\n\tldur\tx0, [x29, #-8]\n\tadrp\tx8, _AC97_SIGMATEL_BIAS2@GOTPAGE\n\tldr\tx8, [x8, _AC97_SIGMATEL_BIAS2@GOTPAGEOFF]\n\tldr\tw1, [x8]\n\tbl\t_snd_ac97_read\n\tand\tw8, w0, #0x8000\n\tstur\tw8, [x29, #-12]\n\tldur\tx0, [x29, #-8]\n\tadrp\tx8, _AC97_SIGMATEL_ANALOG@GOTPAGE\n\tldr\tx8, [x8, _AC97_SIGMATEL_ANALOG@GOTPAGEOFF]\n\tldr\tw1, [x8]\n\tbl\t_snd_ac97_read\n\tstr\tw0, [sp, #16]\n\tldur\tw8, [x29, #-12]\n\tsubs\tw8, w8, #0\n\tcset\tw8, ne\n\ttbnz\tw8, #0, LBB0_3\n\tb\tLBB0_1\nLBB0_1:\n\tldr\tw8, [sp, #16]\n\tsubs\tw8, w8, #0\n\tcset\tw8, ne\n\ttbnz\tw8, #0, LBB0_3\n\tb\tLBB0_2\nLBB0_2:\n\tldur\tx0, [x29, #-8]\n\tadrp\tx8, _AC97_SIGMATEL_CIC1@GOTPAGE\n\tldr\tx8, [x8, _AC97_SIGMATEL_CIC1@GOTPAGEOFF]\n\tldr\tw1, [x8]\n\tmov\tw2, #43962\n\tstr\tw2, [sp, #12] ; 4-byte Folded Spill\n\tbl\t_snd_ac97_write_cache\n\tldur\tx0, [x29, #-8]\n\tadrp\tx8, _AC97_SIGMATEL_CIC2@GOTPAGE\n\tldr\tx8, [x8, _AC97_SIGMATEL_CIC2@GOTPAGEOFF]\n\tldr\tw1, [x8]\n\tmov\tw2, #4096\n\tbl\t_snd_ac97_write_cache\n\tldr\tw2, [sp, #12] ; 4-byte Folded Reload\n\tldur\tx0, [x29, #-8]\n\tadrp\tx8, _AC97_SIGMATEL_BIAS1@GOTPAGE\n\tldr\tx8, [x8, _AC97_SIGMATEL_BIAS1@GOTPAGEOFF]\n\tldr\tw1, [x8]\n\tbl\t_snd_ac97_write_cache\n\tldur\tx0, [x29, #-8]\n\tadrp\tx8, _AC97_SIGMATEL_BIAS2@GOTPAGE\n\tldr\tx8, [x8, _AC97_SIGMATEL_BIAS2@GOTPAGEOFF]\n\tldr\tw1, [x8]\n\tmov\tw2, #7\n\n```", "role": "user" }, { "content": "```armasm\n\tbl\t_snd_ac97_write_cache\n\tb\tLBB0_11\nLBB0_3:\n\tldur\tw8, [x29, #-12]\n\tsubs\tw8, w8, #8, lsl #12 ; =32768\n\tcset\tw8, ne\n\ttbnz\tw8, #0, LBB0_6\n\tb\tLBB0_4\nLBB0_4:\n\tldr\tw8, [sp, #16]\n\tsubs\tw8, w8, #0\n\tcset\tw8, ne\n\ttbnz\tw8, #0, LBB0_6\n\tb\tLBB0_5\nLBB0_5:\n\tldur\tx0, [x29, #-8]\n\tadrp\tx8, _AC97_SIGMATEL_CIC1@GOTPAGE\n\tldr\tx8, [x8, _AC97_SIGMATEL_CIC1@GOTPAGEOFF]\n\tldr\tw1, [x8]\n\tmov\tw2, #43962\n\tbl\t_snd_ac97_write_cache\n\tldur\tx0, [x29, #-8]\n\tadrp\tx8, _AC97_SIGMATEL_CIC2@GOTPAGE\n\tldr\tx8, [x8, _AC97_SIGMATEL_CIC2@GOTPAGEOFF]\n```", "role": "assistant" } ]
extr_ac97_patch.c_patch_sigmatel_stac9708.c
[ { "content": "You are given an x86 assembly block (<block>) to traspile into armv8_64 assembly.\nYou are also given the context for this block in the form of pre-context (<pre_context>) and post-context (<post_context>).\nThere is also a pre-target-context (<pre_target>) which is the context for the target block. Use the input pre and post context along with the target pre context to transpile the block from x86 to armv8_64.\n\n```x86asm\n; <pre-context>\n\tjne\t.LBB0_6\n# %bb.5:\n\tmovq\t-8(%rbp), %rdi\n\tmovl\tAC97_SIGMATEL_CIC1(%rip), %esi\n\tmovl\t$43962, %edx # imm = 0xABBA\n\tcallq\tsnd_ac97_write_cache@PLT\n\tmovq\t-8(%rbp), %rdi\n\n; <block>\n\tmovl\tAC97_SIGMATEL_CIC2(%rip), %esi\n\tmovl\t$4097, %edx # imm = 0x1001\n\tcallq\tsnd_ac97_write_cache@PLT\n\tmovq\t-8(%rbp), %rdi\n\tmovl\tAC97_SIGMATEL_DAC2INVERT(%rip), %esi\n\tmovl\t$8, %edx\n\tcallq\tsnd_ac97_write_cache@PLT\n\tjmp\t.LBB0_10\n.LBB0_6:\n\tcmpl\t$32768, -12(%rbp) # imm = 0x8000\n\tjne\t.LBB0_9\n# %bb.7:\n\tcmpl\t$128, -16(%rbp)\n\tjne\t.LBB0_9\n# %bb.8:\n\n; <post-context>\n\tjmp\t.LBB0_9\n.LBB0_9:\n\tjmp\t.LBB0_10\n.LBB0_10:\n\tjmp\t.LBB0_11\n.LBB0_11:\n\tmovq\t-8(%rbp), %rdi\n\tmovl\tAC97_SIGMATEL_MULTICHN(%rip), %esi\n\txorl\t%edx, %edx\n\tcallq\tsnd_ac97_write_cache@PLT\n\txorl\t%eax, %eax\n\n```\n\n```armasm\n; <pre-target>\n\t.cfi_startproc\n; %bb.0:\n\tsub\tsp, sp, #48\n\t.cfi_def_cfa_offset 48\n\tstp\tx29, x30, [sp, #32] ; 16-byte Folded Spill\n\tadd\tx29, sp, #32\n\t.cfi_def_cfa w29, 16\n\t.cfi_offset w30, -8\n\t.cfi_offset w29, -16\n\tstur\tx0, [x29, #-8]\n\tldur\tx9, [x29, #-8]\n\tadrp\tx8, _patch_sigmatel_stac9708_ops@GOTPAGE\n\tldr\tx8, [x8, _patch_sigmatel_stac9708_ops@GOTPAGEOFF]\n\tstr\tx8, [x9, #8]\n\tldur\tx9, [x29, #-8]\n\tldr\tw8, [x9]\n\torr\tw8, w8, #0x10\n\tstr\tw8, [x9]\n\tldur\tx0, [x29, #-8]\n\tadrp\tx8, _AC97_SIGMATEL_BIAS2@GOTPAGE\n\tldr\tx8, [x8, _AC97_SIGMATEL_BIAS2@GOTPAGEOFF]\n\tldr\tw1, [x8]\n\tbl\t_snd_ac97_read\n\tand\tw8, w0, #0x8000\n\tstur\tw8, [x29, #-12]\n\tldur\tx0, [x29, #-8]\n\tadrp\tx8, _AC97_SIGMATEL_ANALOG@GOTPAGE\n\tldr\tx8, [x8, _AC97_SIGMATEL_ANALOG@GOTPAGEOFF]\n\tldr\tw1, [x8]\n\tbl\t_snd_ac97_read\n\tstr\tw0, [sp, #16]\n\tldur\tw8, [x29, #-12]\n\tsubs\tw8, w8, #0\n\tcset\tw8, ne\n\ttbnz\tw8, #0, LBB0_3\n\tb\tLBB0_1\nLBB0_1:\n\tldr\tw8, [sp, #16]\n\tsubs\tw8, w8, #0\n\tcset\tw8, ne\n\ttbnz\tw8, #0, LBB0_3\n\tb\tLBB0_2\nLBB0_2:\n\tldur\tx0, [x29, #-8]\n\tadrp\tx8, _AC97_SIGMATEL_CIC1@GOTPAGE\n\tldr\tx8, [x8, _AC97_SIGMATEL_CIC1@GOTPAGEOFF]\n\tldr\tw1, [x8]\n\tmov\tw2, #43962\n\tstr\tw2, [sp, #12] ; 4-byte Folded Spill\n\tbl\t_snd_ac97_write_cache\n\tldur\tx0, [x29, #-8]\n\tadrp\tx8, _AC97_SIGMATEL_CIC2@GOTPAGE\n\tldr\tx8, [x8, _AC97_SIGMATEL_CIC2@GOTPAGEOFF]\n\tldr\tw1, [x8]\n\tmov\tw2, #4096\n\tbl\t_snd_ac97_write_cache\n\tldr\tw2, [sp, #12] ; 4-byte Folded Reload\n\tldur\tx0, [x29, #-8]\n\tadrp\tx8, _AC97_SIGMATEL_BIAS1@GOTPAGE\n\tldr\tx8, [x8, _AC97_SIGMATEL_BIAS1@GOTPAGEOFF]\n\tldr\tw1, [x8]\n\tbl\t_snd_ac97_write_cache\n\tldur\tx0, [x29, #-8]\n\tadrp\tx8, _AC97_SIGMATEL_BIAS2@GOTPAGE\n\tldr\tx8, [x8, _AC97_SIGMATEL_BIAS2@GOTPAGEOFF]\n\tldr\tw1, [x8]\n\tmov\tw2, #7\n\tbl\t_snd_ac97_write_cache\n\tb\tLBB0_11\nLBB0_3:\n\tldur\tw8, [x29, #-12]\n\tsubs\tw8, w8, #8, lsl #12 ; =32768\n\tcset\tw8, ne\n\ttbnz\tw8, #0, LBB0_6\n\tb\tLBB0_4\nLBB0_4:\n\tldr\tw8, [sp, #16]\n\tsubs\tw8, w8, #0\n\tcset\tw8, ne\n\ttbnz\tw8, #0, LBB0_6\n\tb\tLBB0_5\nLBB0_5:\n\tldur\tx0, [x29, #-8]\n\tadrp\tx8, _AC97_SIGMATEL_CIC1@GOTPAGE\n\tldr\tx8, [x8, _AC97_SIGMATEL_CIC1@GOTPAGEOFF]\n\tldr\tw1, [x8]\n\tmov\tw2, #43962\n\tbl\t_snd_ac97_write_cache\n\tldur\tx0, [x29, #-8]\n\tadrp\tx8, _AC97_SIGMATEL_CIC2@GOTPAGE\n\tldr\tx8, [x8, _AC97_SIGMATEL_CIC2@GOTPAGEOFF]\n\n```", "role": "user" }, { "content": "```armasm\n\tldr\tw1, [x8]\n\tmov\tw2, #4097\n\tbl\t_snd_ac97_write_cache\n\tldur\tx0, [x29, #-8]\n\tadrp\tx8, _AC97_SIGMATEL_DAC2INVERT@GOTPAGE\n\tldr\tx8, [x8, _AC97_SIGMATEL_DAC2INVERT@GOTPAGEOFF]\n\tldr\tw1, [x8]\n\tmov\tw2, #8\n\tbl\t_snd_ac97_write_cache\n\tb\tLBB0_10\nLBB0_6:\n\tldur\tw8, [x29, #-12]\n\tsubs\tw8, w8, #8, lsl #12 ; =32768\n\tcset\tw8, ne\n\ttbnz\tw8, #0, LBB0_9\n\tb\tLBB0_7\nLBB0_7:\n\tldr\tw8, [sp, #16]\n\tsubs\tw8, w8, #128\n\tcset\tw8, ne\n\ttbnz\tw8, #0, LBB0_9\n\tb\tLBB0_8\nLBB0_8:\n```", "role": "assistant" } ]
extr_ac97_patch.c_patch_sigmatel_stac9708.c
[ { "content": "You are given an x86 assembly block (<block>) to traspile into armv8_64 assembly.\nYou are also given the context for this block in the form of pre-context (<pre_context>) and post-context (<post_context>).\nThere is also a pre-target-context (<pre_target>) which is the context for the target block. Use the input pre and post context along with the target pre context to transpile the block from x86 to armv8_64.\n\n```x86asm\n; <pre-context>\n\tjmp\t.LBB0_10\n.LBB0_6:\n\tcmpl\t$32768, -12(%rbp) # imm = 0x8000\n\tjne\t.LBB0_9\n# %bb.7:\n\tcmpl\t$128, -16(%rbp)\n\tjne\t.LBB0_9\n# %bb.8:\n\n; <block>\n\tjmp\t.LBB0_9\n.LBB0_9:\n\tjmp\t.LBB0_10\n.LBB0_10:\n\tjmp\t.LBB0_11\n.LBB0_11:\n\tmovq\t-8(%rbp), %rdi\n\tmovl\tAC97_SIGMATEL_MULTICHN(%rip), %esi\n\txorl\t%edx, %edx\n\tcallq\tsnd_ac97_write_cache@PLT\n\txorl\t%eax, %eax\n\taddq\t$16, %rsp\n\tpopq\t%rbp\n\t.cfi_def_cfa %rsp, 8\n\tretq\n.Lfunc_end0:\n\t.size\tpatch_sigmatel_stac9708, .Lfunc_end0-patch_sigmatel_stac9708\n\t.cfi_endproc\n # -- End function\n\t.type\tpatch_sigmatel_stac9708_ops,@object # @patch_sigmatel_stac9708_ops\n\t.bss\n\t.globl\tpatch_sigmatel_stac9708_ops\n\t.p2align\t2, 0x0\npatch_sigmatel_stac9708_ops:\n\t.long\t0 # 0x0\n\t.size\tpatch_sigmatel_stac9708_ops, 4\n\n\t.type\tAC97_SIGMATEL_BIAS2,@object # @AC97_SIGMATEL_BIAS2\n\t.globl\tAC97_SIGMATEL_BIAS2\n\t.p2align\t2, 0x0\nAC97_SIGMATEL_BIAS2:\n\t.long\t0 # 0x0\n\t.size\tAC97_SIGMATEL_BIAS2, 4\n\n\t.type\tAC97_SIGMATEL_ANALOG,@object # @AC97_SIGMATEL_ANALOG\n\t.globl\tAC97_SIGMATEL_ANALOG\n\t.p2align\t2, 0x0\nAC97_SIGMATEL_ANALOG:\n\t.long\t0 # 0x0\n\t.size\tAC97_SIGMATEL_ANALOG, 4\n\n\t.type\tAC97_SIGMATEL_CIC1,@object # @AC97_SIGMATEL_CIC1\n\t.globl\tAC97_SIGMATEL_CIC1\n\t.p2align\t2, 0x0\nAC97_SIGMATEL_CIC1:\n\t.long\t0 # 0x0\n\t.size\tAC97_SIGMATEL_CIC1, 4\n\n\t.type\tAC97_SIGMATEL_CIC2,@object # @AC97_SIGMATEL_CIC2\n\t.globl\tAC97_SIGMATEL_CIC2\n\t.p2align\t2, 0x0\nAC97_SIGMATEL_CIC2:\n\t.long\t0 # 0x0\n\t.size\tAC97_SIGMATEL_CIC2, 4\n\n\t.type\tAC97_SIGMATEL_BIAS1,@object # @AC97_SIGMATEL_BIAS1\n\t.globl\tAC97_SIGMATEL_BIAS1\n\t.p2align\t2, 0x0\nAC97_SIGMATEL_BIAS1:\n\t.long\t0 # 0x0\n\t.size\tAC97_SIGMATEL_BIAS1, 4\n\n\t.type\tAC97_SIGMATEL_DAC2INVERT,@object # @AC97_SIGMATEL_DAC2INVERT\n\t.globl\tAC97_SIGMATEL_DAC2INVERT\n\t.p2align\t2, 0x0\nAC97_SIGMATEL_DAC2INVERT:\n\t.long\t0 # 0x0\n\t.size\tAC97_SIGMATEL_DAC2INVERT, 4\n\n\t.type\tAC97_SIGMATEL_MULTICHN,@object # @AC97_SIGMATEL_MULTICHN\n\t.globl\tAC97_SIGMATEL_MULTICHN\n\t.p2align\t2, 0x0\nAC97_SIGMATEL_MULTICHN:\n\t.long\t0 # 0x0\n\t.size\tAC97_SIGMATEL_MULTICHN, 4\n\n\t.ident\t\"Ubuntu clang version 18.1.3 (1ubuntu1)\"\n\t.section\t\".note.GNU-stack\",\"\",@progbits\n\t.addrsig\n\t.addrsig_sym patch_sigmatel_stac9708\n\t.addrsig_sym snd_ac97_read\n\t.addrsig_sym snd_ac97_write_cache\n\t.addrsig_sym patch_sigmatel_stac9708_ops\n\t.addrsig_sym AC97_SIGMATEL_BIAS2\n\t.addrsig_sym AC97_SIGMATEL_ANALOG\n\t.addrsig_sym AC97_SIGMATEL_CIC1\n\t.addrsig_sym AC97_SIGMATEL_CIC2\n\t.addrsig_sym AC97_SIGMATEL_BIAS1\n\t.addrsig_sym AC97_SIGMATEL_DAC2INVERT\n\t.addrsig_sym AC97_SIGMATEL_MULTICHN\n\n; <post-context>\n\n```\n\n```armasm\n; <pre-target>\n\t.cfi_startproc\n; %bb.0:\n\tsub\tsp, sp, #48\n\t.cfi_def_cfa_offset 48\n\tstp\tx29, x30, [sp, #32] ; 16-byte Folded Spill\n\tadd\tx29, sp, #32\n\t.cfi_def_cfa w29, 16\n\t.cfi_offset w30, -8\n\t.cfi_offset w29, -16\n\tstur\tx0, [x29, #-8]\n\tldur\tx9, [x29, #-8]\n\tadrp\tx8, _patch_sigmatel_stac9708_ops@GOTPAGE\n\tldr\tx8, [x8, _patch_sigmatel_stac9708_ops@GOTPAGEOFF]\n\tstr\tx8, [x9, #8]\n\tldur\tx9, [x29, #-8]\n\tldr\tw8, [x9]\n\torr\tw8, w8, #0x10\n\tstr\tw8, [x9]\n\tldur\tx0, [x29, #-8]\n\tadrp\tx8, _AC97_SIGMATEL_BIAS2@GOTPAGE\n\tldr\tx8, [x8, _AC97_SIGMATEL_BIAS2@GOTPAGEOFF]\n\tldr\tw1, [x8]\n\tbl\t_snd_ac97_read\n\tand\tw8, w0, #0x8000\n\tstur\tw8, [x29, #-12]\n\tldur\tx0, [x29, #-8]\n\tadrp\tx8, _AC97_SIGMATEL_ANALOG@GOTPAGE\n\tldr\tx8, [x8, _AC97_SIGMATEL_ANALOG@GOTPAGEOFF]\n\tldr\tw1, [x8]\n\tbl\t_snd_ac97_read\n\tstr\tw0, [sp, #16]\n\tldur\tw8, [x29, #-12]\n\tsubs\tw8, w8, #0\n\tcset\tw8, ne\n\ttbnz\tw8, #0, LBB0_3\n\tb\tLBB0_1\nLBB0_1:\n\tldr\tw8, [sp, #16]\n\tsubs\tw8, w8, #0\n\tcset\tw8, ne\n\ttbnz\tw8, #0, LBB0_3\n\tb\tLBB0_2\nLBB0_2:\n\tldur\tx0, [x29, #-8]\n\tadrp\tx8, _AC97_SIGMATEL_CIC1@GOTPAGE\n\tldr\tx8, [x8, _AC97_SIGMATEL_CIC1@GOTPAGEOFF]\n\tldr\tw1, [x8]\n\tmov\tw2, #43962\n\tstr\tw2, [sp, #12] ; 4-byte Folded Spill\n\tbl\t_snd_ac97_write_cache\n\tldur\tx0, [x29, #-8]\n\tadrp\tx8, _AC97_SIGMATEL_CIC2@GOTPAGE\n\tldr\tx8, [x8, _AC97_SIGMATEL_CIC2@GOTPAGEOFF]\n\tldr\tw1, [x8]\n\tmov\tw2, #4096\n\tbl\t_snd_ac97_write_cache\n\tldr\tw2, [sp, #12] ; 4-byte Folded Reload\n\tldur\tx0, [x29, #-8]\n\tadrp\tx8, _AC97_SIGMATEL_BIAS1@GOTPAGE\n\tldr\tx8, [x8, _AC97_SIGMATEL_BIAS1@GOTPAGEOFF]\n\tldr\tw1, [x8]\n\tbl\t_snd_ac97_write_cache\n\tldur\tx0, [x29, #-8]\n\tadrp\tx8, _AC97_SIGMATEL_BIAS2@GOTPAGE\n\tldr\tx8, [x8, _AC97_SIGMATEL_BIAS2@GOTPAGEOFF]\n\tldr\tw1, [x8]\n\tmov\tw2, #7\n\tbl\t_snd_ac97_write_cache\n\tb\tLBB0_11\nLBB0_3:\n\tldur\tw8, [x29, #-12]\n\tsubs\tw8, w8, #8, lsl #12 ; =32768\n\tcset\tw8, ne\n\ttbnz\tw8, #0, LBB0_6\n\tb\tLBB0_4\nLBB0_4:\n\tldr\tw8, [sp, #16]\n\tsubs\tw8, w8, #0\n\tcset\tw8, ne\n\ttbnz\tw8, #0, LBB0_6\n\tb\tLBB0_5\nLBB0_5:\n\tldur\tx0, [x29, #-8]\n\tadrp\tx8, _AC97_SIGMATEL_CIC1@GOTPAGE\n\tldr\tx8, [x8, _AC97_SIGMATEL_CIC1@GOTPAGEOFF]\n\tldr\tw1, [x8]\n\tmov\tw2, #43962\n\tbl\t_snd_ac97_write_cache\n\tldur\tx0, [x29, #-8]\n\tadrp\tx8, _AC97_SIGMATEL_CIC2@GOTPAGE\n\tldr\tx8, [x8, _AC97_SIGMATEL_CIC2@GOTPAGEOFF]\n\tldr\tw1, [x8]\n\tmov\tw2, #4097\n\tbl\t_snd_ac97_write_cache\n\tldur\tx0, [x29, #-8]\n\tadrp\tx8, _AC97_SIGMATEL_DAC2INVERT@GOTPAGE\n\tldr\tx8, [x8, _AC97_SIGMATEL_DAC2INVERT@GOTPAGEOFF]\n\tldr\tw1, [x8]\n\tmov\tw2, #8\n\tbl\t_snd_ac97_write_cache\n\tb\tLBB0_10\nLBB0_6:\n\tldur\tw8, [x29, #-12]\n\tsubs\tw8, w8, #8, lsl #12 ; =32768\n\tcset\tw8, ne\n\ttbnz\tw8, #0, LBB0_9\n\tb\tLBB0_7\nLBB0_7:\n\tldr\tw8, [sp, #16]\n\tsubs\tw8, w8, #128\n\tcset\tw8, ne\n\ttbnz\tw8, #0, LBB0_9\n\tb\tLBB0_8\nLBB0_8:\n\n```", "role": "user" }, { "content": "```armasm\n\tb\tLBB0_9\nLBB0_9:\n\tb\tLBB0_10\nLBB0_10:\n\tb\tLBB0_11\nLBB0_11:\n\tldur\tx0, [x29, #-8]\n\tadrp\tx8, _AC97_SIGMATEL_MULTICHN@GOTPAGE\n\tldr\tx8, [x8, _AC97_SIGMATEL_MULTICHN@GOTPAGEOFF]\n\tldr\tw1, [x8]\n\tmov\tw2, #0\n\tstr\tw2, [sp, #8] ; 4-byte Folded Spill\n\tbl\t_snd_ac97_write_cache\n\tldr\tw0, [sp, #8] ; 4-byte Folded Reload\n\tldp\tx29, x30, [sp, #32] ; 16-byte Folded Reload\n\tadd\tsp, sp, #48\n\tret\n\t.cfi_endproc\n ; -- End function\n\t.comm\t_patch_sigmatel_stac9708_ops,4,2 ; @patch_sigmatel_stac9708_ops\n\t.comm\t_AC97_SIGMATEL_BIAS2,4,2 ; @AC97_SIGMATEL_BIAS2\n\t.comm\t_AC97_SIGMATEL_ANALOG,4,2 ; @AC97_SIGMATEL_ANALOG\n\t.comm\t_AC97_SIGMATEL_CIC1,4,2 ; @AC97_SIGMATEL_CIC1\n\t.comm\t_AC97_SIGMATEL_CIC2,4,2 ; @AC97_SIGMATEL_CIC2\n\t.comm\t_AC97_SIGMATEL_BIAS1,4,2 ; @AC97_SIGMATEL_BIAS1\n\t.comm\t_AC97_SIGMATEL_DAC2INVERT,4,2 ; @AC97_SIGMATEL_DAC2INVERT\n\t.comm\t_AC97_SIGMATEL_MULTICHN,4,2 ; @AC97_SIGMATEL_MULTICHN\n\t.no_dead_strip\t_patch_sigmatel_stac9708\n.subsections_via_symbols\n```", "role": "assistant" } ]
extr_drm_vblank.c_drm_get_last_vbltimestamp.c
[ { "content": "You are given an x86 assembly block (<block>) to traspile into armv8_64 assembly.\nYou are also given the context for this block in the form of pre-context (<pre_context>) and post-context (<post_context>).\nThere is also a pre-target-context (<pre_target>) which is the context for the target block. Use the input pre and post context along with the target pre context to transpile the block from x86 to armv8_64.\n\n```x86asm\n; <pre-context>\n\n; <block>\n\t.text\n\t.file\t\"extr_drm_vblank.c_drm_get_last_vbltimestamp.c\"\n\t.p2align\t4, 0x90 # -- Begin function drm_get_last_vbltimestamp\n\t.type\tdrm_get_last_vbltimestamp,@function\ndrm_get_last_vbltimestamp: # @drm_get_last_vbltimestamp\n\t.cfi_startproc\n# %bb.0:\n\tpushq\t%rbp\n\t.cfi_def_cfa_offset 16\n\t.cfi_offset %rbp, -16\n\tmovq\t%rsp, %rbp\n\t.cfi_def_cfa_register %rbp\n\tsubq\t$48, %rsp\n\tmovq\t%rdi, -8(%rbp)\n\tmovl\t%esi, -12(%rbp)\n\tmovq\t%rdx, -24(%rbp)\n\tmovl\t%ecx, -28(%rbp)\n\tmovl\t$0, -32(%rbp)\n\tmovq\tdrm_timestamp_precision(%rip), %rax\n # kill: def $eax killed $eax killed $rax\n\timull\t$1000, %eax, %eax # imm = 0x3E8\n\tmovl\t%eax, -36(%rbp)\n\tmovq\t-8(%rbp), %rax\n\tmovq\t(%rax), %rax\n\tcmpq\t$0, (%rax)\n\tje\t.LBB0_3\n# %bb.1:\n\n; <post-context>\n\tcmpl\t$0, -36(%rbp)\n\tjle\t.LBB0_3\n# %bb.2:\n\tmovq\t-8(%rbp), %rax\n\tmovq\t(%rax), %rax\n\tmovq\t(%rax), %rax\n\tmovq\t-8(%rbp), %rdi\n\n```\n\n```armasm\n; <pre-target>\n\n```", "role": "user" }, { "content": "```armasm\n\t.section\t__TEXT,__text,regular,pure_instructions\n\t.build_version macos, 13, 0\tsdk_version 13, 3\n\t.p2align\t2 ; -- Begin function drm_get_last_vbltimestamp\n_drm_get_last_vbltimestamp: ; @drm_get_last_vbltimestamp\n\t.cfi_startproc\n; %bb.0:\n\tsub\tsp, sp, #64\n\t.cfi_def_cfa_offset 64\n\tstp\tx29, x30, [sp, #48] ; 16-byte Folded Spill\n\tadd\tx29, sp, #48\n\t.cfi_def_cfa w29, 16\n\t.cfi_offset w30, -8\n\t.cfi_offset w29, -16\n\tstur\tx0, [x29, #-8]\n\tstur\tw1, [x29, #-12]\n\tstr\tx2, [sp, #24]\n\tstr\tw3, [sp, #20]\n\tstr\twzr, [sp, #16]\n\tadrp\tx8, _drm_timestamp_precision@GOTPAGE\n\tldr\tx8, [x8, _drm_timestamp_precision@GOTPAGEOFF]\n\tldr\tx8, [x8]\n ; kill: def $w8 killed $w8 killed $x8\n\tmov\tw9, #1000\n\tmul\tw8, w8, w9\n\tstr\tw8, [sp, #12]\n\tldur\tx8, [x29, #-8]\n\tldr\tx8, [x8]\n\tldr\tx8, [x8]\n\tsubs\tx8, x8, #0\n\tcset\tw8, eq\n\ttbnz\tw8, #0, LBB0_3\n\tb\tLBB0_1\nLBB0_1:\n\tldr\tw8, [sp, #12]\n```", "role": "assistant" } ]
extr_drm_vblank.c_drm_get_last_vbltimestamp.c
[ { "content": "You are given an x86 assembly block (<block>) to traspile into armv8_64 assembly.\nYou are also given the context for this block in the form of pre-context (<pre_context>) and post-context (<post_context>).\nThere is also a pre-target-context (<pre_target>) which is the context for the target block. Use the input pre and post context along with the target pre context to transpile the block from x86 to armv8_64.\n\n```x86asm\n; <pre-context>\n\tmovl\t%eax, -36(%rbp)\n\tmovq\t-8(%rbp), %rax\n\tmovq\t(%rax), %rax\n\tcmpq\t$0, (%rax)\n\tje\t.LBB0_3\n# %bb.1:\n\n; <block>\n\tcmpl\t$0, -36(%rbp)\n\tjle\t.LBB0_3\n# %bb.2:\n\tmovq\t-8(%rbp), %rax\n\tmovq\t(%rax), %rax\n\tmovq\t(%rax), %rax\n\tmovq\t-8(%rbp), %rdi\n\tmovl\t-12(%rbp), %esi\n\tmovq\t-24(%rbp), %rcx\n\tmovl\t-28(%rbp), %r8d\n\tleaq\t-36(%rbp), %rdx\n\tcallq\t*%rax\n\tmovl\t%eax, -32(%rbp)\n.LBB0_3:\n\n; <post-context>\n\tcmpl\t$0, -32(%rbp)\n\tjne\t.LBB0_5\n# %bb.4:\n\tmovb\t$0, %al\n\tcallq\tktime_get@PLT\n\tmovl\t%eax, %ecx\n\tmovq\t-24(%rbp), %rax\n\tmovl\t%ecx, (%rax)\n.LBB0_5:\n\n```\n\n```armasm\n; <pre-target>\n\t.cfi_startproc\n; %bb.0:\n\tsub\tsp, sp, #64\n\t.cfi_def_cfa_offset 64\n\tstp\tx29, x30, [sp, #48] ; 16-byte Folded Spill\n\tadd\tx29, sp, #48\n\t.cfi_def_cfa w29, 16\n\t.cfi_offset w30, -8\n\t.cfi_offset w29, -16\n\tstur\tx0, [x29, #-8]\n\tstur\tw1, [x29, #-12]\n\tstr\tx2, [sp, #24]\n\tstr\tw3, [sp, #20]\n\tstr\twzr, [sp, #16]\n\tadrp\tx8, _drm_timestamp_precision@GOTPAGE\n\tldr\tx8, [x8, _drm_timestamp_precision@GOTPAGEOFF]\n\tldr\tx8, [x8]\n ; kill: def $w8 killed $w8 killed $x8\n\tmov\tw9, #1000\n\tmul\tw8, w8, w9\n\tstr\tw8, [sp, #12]\n\tldur\tx8, [x29, #-8]\n\tldr\tx8, [x8]\n\tldr\tx8, [x8]\n\tsubs\tx8, x8, #0\n\tcset\tw8, eq\n\ttbnz\tw8, #0, LBB0_3\n\tb\tLBB0_1\nLBB0_1:\n\tldr\tw8, [sp, #12]\n\n```", "role": "user" }, { "content": "```armasm\n\tsubs\tw8, w8, #0\n\tcset\tw8, le\n\ttbnz\tw8, #0, LBB0_3\n\tb\tLBB0_2\nLBB0_2:\n\tldur\tx8, [x29, #-8]\n\tldr\tx8, [x8]\n\tldr\tx8, [x8]\n\tldur\tx0, [x29, #-8]\n\tldur\tw1, [x29, #-12]\n\tldr\tx3, [sp, #24]\n\tldr\tw4, [sp, #20]\n\tadd\tx2, sp, #12\n\tblr\tx8\n\tstr\tw0, [sp, #16]\n\tb\tLBB0_3\nLBB0_3:\n```", "role": "assistant" } ]
extr_drm_vblank.c_drm_get_last_vbltimestamp.c
[ { "content": "You are given an x86 assembly block (<block>) to traspile into armv8_64 assembly.\nYou are also given the context for this block in the form of pre-context (<pre_context>) and post-context (<post_context>).\nThere is also a pre-target-context (<pre_target>) which is the context for the target block. Use the input pre and post context along with the target pre context to transpile the block from x86 to armv8_64.\n\n```x86asm\n; <pre-context>\n\tmovl\t-12(%rbp), %esi\n\tmovq\t-24(%rbp), %rcx\n\tmovl\t-28(%rbp), %r8d\n\tleaq\t-36(%rbp), %rdx\n\tcallq\t*%rax\n\tmovl\t%eax, -32(%rbp)\n.LBB0_3:\n\n; <block>\n\tcmpl\t$0, -32(%rbp)\n\tjne\t.LBB0_5\n# %bb.4:\n\tmovb\t$0, %al\n\tcallq\tktime_get@PLT\n\tmovl\t%eax, %ecx\n\tmovq\t-24(%rbp), %rax\n\tmovl\t%ecx, (%rax)\n.LBB0_5:\n\tmovl\t-32(%rbp), %eax\n\taddq\t$48, %rsp\n\tpopq\t%rbp\n\t.cfi_def_cfa %rsp, 8\n\tretq\n.Lfunc_end0:\n\t.size\tdrm_get_last_vbltimestamp, .Lfunc_end0-drm_get_last_vbltimestamp\n\t.cfi_endproc\n # -- End function\n\t.type\tdrm_timestamp_precision,@object # @drm_timestamp_precision\n\t.bss\n\t.globl\tdrm_timestamp_precision\n\t.p2align\t3, 0x0\ndrm_timestamp_precision:\n\t.quad\t0 # 0x0\n\t.size\tdrm_timestamp_precision, 8\n\n\t.ident\t\"Ubuntu clang version 18.1.3 (1ubuntu1)\"\n\t.section\t\".note.GNU-stack\",\"\",@progbits\n\t.addrsig\n\t.addrsig_sym drm_get_last_vbltimestamp\n\t.addrsig_sym ktime_get\n\t.addrsig_sym drm_timestamp_precision\n\n; <post-context>\n\n```\n\n```armasm\n; <pre-target>\n\t.cfi_startproc\n; %bb.0:\n\tsub\tsp, sp, #64\n\t.cfi_def_cfa_offset 64\n\tstp\tx29, x30, [sp, #48] ; 16-byte Folded Spill\n\tadd\tx29, sp, #48\n\t.cfi_def_cfa w29, 16\n\t.cfi_offset w30, -8\n\t.cfi_offset w29, -16\n\tstur\tx0, [x29, #-8]\n\tstur\tw1, [x29, #-12]\n\tstr\tx2, [sp, #24]\n\tstr\tw3, [sp, #20]\n\tstr\twzr, [sp, #16]\n\tadrp\tx8, _drm_timestamp_precision@GOTPAGE\n\tldr\tx8, [x8, _drm_timestamp_precision@GOTPAGEOFF]\n\tldr\tx8, [x8]\n ; kill: def $w8 killed $w8 killed $x8\n\tmov\tw9, #1000\n\tmul\tw8, w8, w9\n\tstr\tw8, [sp, #12]\n\tldur\tx8, [x29, #-8]\n\tldr\tx8, [x8]\n\tldr\tx8, [x8]\n\tsubs\tx8, x8, #0\n\tcset\tw8, eq\n\ttbnz\tw8, #0, LBB0_3\n\tb\tLBB0_1\nLBB0_1:\n\tldr\tw8, [sp, #12]\n\tsubs\tw8, w8, #0\n\tcset\tw8, le\n\ttbnz\tw8, #0, LBB0_3\n\tb\tLBB0_2\nLBB0_2:\n\tldur\tx8, [x29, #-8]\n\tldr\tx8, [x8]\n\tldr\tx8, [x8]\n\tldur\tx0, [x29, #-8]\n\tldur\tw1, [x29, #-12]\n\tldr\tx3, [sp, #24]\n\tldr\tw4, [sp, #20]\n\tadd\tx2, sp, #12\n\tblr\tx8\n\tstr\tw0, [sp, #16]\n\tb\tLBB0_3\nLBB0_3:\n\n```", "role": "user" }, { "content": "```armasm\n\tldr\tw8, [sp, #16]\n\tsubs\tw8, w8, #0\n\tcset\tw8, ne\n\ttbnz\tw8, #0, LBB0_5\n\tb\tLBB0_4\nLBB0_4:\n\tbl\t_ktime_get\n\tldr\tx8, [sp, #24]\n\tstr\tw0, [x8]\n\tb\tLBB0_5\nLBB0_5:\n\tldr\tw0, [sp, #16]\n\tldp\tx29, x30, [sp, #48] ; 16-byte Folded Reload\n\tadd\tsp, sp, #64\n\tret\n\t.cfi_endproc\n ; -- End function\n\t.comm\t_drm_timestamp_precision,8,3 ; @drm_timestamp_precision\n\t.no_dead_strip\t_drm_get_last_vbltimestamp\n.subsections_via_symbols\n```", "role": "assistant" } ]
extr_pg_stat_statements.c_pgss_ProcessUtility.c
[ { "content": "You are given an x86 assembly block (<block>) to traspile into armv8_64 assembly.\nYou are also given the context for this block in the form of pre-context (<pre_context>) and post-context (<post_context>).\nThere is also a pre-target-context (<pre_target>) which is the context for the target block. Use the input pre and post context along with the target pre context to transpile the block from x86 to armv8_64.\n\n```x86asm\n; <pre-context>\n\n; <block>\n\t.text\n\t.file\t\"extr_pg_stat_statements.c_pgss_ProcessUtility.c\"\n\t.p2align\t4, 0x90 # -- Begin function pgss_ProcessUtility\n\t.type\tpgss_ProcessUtility,@function\npgss_ProcessUtility: # @pgss_ProcessUtility\n\t.cfi_startproc\n# %bb.0:\n\tpushq\t%rbp\n\t.cfi_def_cfa_offset 16\n\t.cfi_offset %rbp, -16\n\tmovq\t%rsp, %rbp\n\t.cfi_def_cfa_register %rbp\n\tsubq\t$272, %rsp # imm = 0x110\n\tmovq\t16(%rbp), %rax\n\tmovq\t%rdi, -8(%rbp)\n\tmovq\t%rsi, -16(%rbp)\n\tmovl\t%edx, -20(%rbp)\n\tmovl\t%ecx, -24(%rbp)\n\tmovq\t%r8, -32(%rbp)\n\tmovq\t%r9, -40(%rbp)\n\tmovq\t-8(%rbp), %rax\n\tmovq\t8(%rax), %rax\n\tmovq\t%rax, -48(%rbp)\n\tcmpq\t$0, pgss_track_utility(%rip)\n\tje\t.LBB0_13\n# %bb.1:\n\tmovb\t$0, %al\n\tcallq\tpgss_enabled@PLT\n\tcmpq\t$0, %rax\n\tje\t.LBB0_13\n# %bb.2:\n\tmovq\t-48(%rbp), %rdi\n\n; <post-context>\n\tmovl\tExecuteStmt(%rip), %esi\n\tcallq\tIsA@PLT\n\tcmpl\t$0, %eax\n\tjne\t.LBB0_13\n# %bb.3:\n\tmovq\t-48(%rbp), %rdi\n\tmovl\tPrepareStmt(%rip), %esi\n\n```\n\n```armasm\n; <pre-target>\n\n```", "role": "user" }, { "content": "```armasm\n\t.section\t__TEXT,__text,regular,pure_instructions\n\t.build_version macos, 13, 0\tsdk_version 13, 3\n\t.p2align\t2 ; -- Begin function pgss_ProcessUtility\n_pgss_ProcessUtility: ; @pgss_ProcessUtility\n\t.cfi_startproc\n; %bb.0:\n\tsub\tsp, sp, #320\n\t.cfi_def_cfa_offset 320\n\tstp\tx28, x27, [sp, #288] ; 16-byte Folded Spill\n\tstp\tx29, x30, [sp, #304] ; 16-byte Folded Spill\n\tadd\tx29, sp, #304\n\t.cfi_def_cfa w29, 16\n\t.cfi_offset w30, -8\n\t.cfi_offset w29, -16\n\t.cfi_offset w27, -24\n\t.cfi_offset w28, -32\n\tadrp\tx8, _pgBufferUsage@GOTPAGE\n\tldr\tx8, [x8, _pgBufferUsage@GOTPAGEOFF]\n\tstr\tx8, [sp, #24] ; 8-byte Folded Spill\n\tadrp\tx8, _nested_level@GOTPAGE\n\tldr\tx8, [x8, _nested_level@GOTPAGEOFF]\n\tstr\tx8, [sp, #32] ; 8-byte Folded Spill\n\tstur\tx0, [x29, #-24]\n\tstur\tx1, [x29, #-32]\n\tstur\tw2, [x29, #-36]\n\tstur\tw3, [x29, #-40]\n\tstur\tx4, [x29, #-48]\n\tstur\tx5, [x29, #-56]\n\tstur\tx6, [x29, #-64]\n\tldur\tx8, [x29, #-24]\n\tldr\tx8, [x8, #8]\n\tstur\tx8, [x29, #-72]\n\tadrp\tx8, _pgss_track_utility@GOTPAGE\n\tldr\tx8, [x8, _pgss_track_utility@GOTPAGEOFF]\n\tldr\tx8, [x8]\n\tsubs\tx8, x8, #0\n\tcset\tw8, eq\n\ttbnz\tw8, #0, LBB0_13\n\tb\tLBB0_1\nLBB0_1:\n\tbl\t_pgss_enabled\n\tsubs\tx8, x0, #0\n\tcset\tw8, eq\n\ttbnz\tw8, #0, LBB0_13\n\tb\tLBB0_2\nLBB0_2:\n\tldur\tx0, [x29, #-72]\n\tadrp\tx8, _ExecuteStmt@GOTPAGE\n\tldr\tx8, [x8, _ExecuteStmt@GOTPAGEOFF]\n```", "role": "assistant" } ]
extr_pg_stat_statements.c_pgss_ProcessUtility.c
[ { "content": "You are given an x86 assembly block (<block>) to traspile into armv8_64 assembly.\nYou are also given the context for this block in the form of pre-context (<pre_context>) and post-context (<post_context>).\nThere is also a pre-target-context (<pre_target>) which is the context for the target block. Use the input pre and post context along with the target pre context to transpile the block from x86 to armv8_64.\n\n```x86asm\n; <pre-context>\n\tcmpq\t$0, pgss_track_utility(%rip)\n\tje\t.LBB0_13\n# %bb.1:\n\tmovb\t$0, %al\n\tcallq\tpgss_enabled@PLT\n\tcmpq\t$0, %rax\n\tje\t.LBB0_13\n# %bb.2:\n\tmovq\t-48(%rbp), %rdi\n\n; <block>\n\tmovl\tExecuteStmt(%rip), %esi\n\tcallq\tIsA@PLT\n\tcmpl\t$0, %eax\n\tjne\t.LBB0_13\n# %bb.3:\n\tmovq\t-48(%rbp), %rdi\n\tmovl\tPrepareStmt(%rip), %esi\n\tcallq\tIsA@PLT\n\tcmpl\t$0, %eax\n\tjne\t.LBB0_13\n# %bb.4:\n\tmovq\t-48(%rbp), %rdi\n\tmovl\tDeallocateStmt(%rip), %esi\n\tcallq\tIsA@PLT\n\tcmpl\t$0, %eax\n\n; <post-context>\n\tjne\t.LBB0_13\n# %bb.5:\n\tleaq\t-152(%rbp), %rdi\n\tleaq\tpgBufferUsage(%rip), %rsi\n\tmovl\t$88, %edx\n\tcallq\tmemcpy@PLT\n\tmovl\t-52(%rbp), %edi\n\tcallq\tINSTR_TIME_SET_CURRENT@PLT\n\tmovl\tnested_level(%rip), %eax\n\taddl\t$1, %eax\n\tmovl\t%eax, nested_level(%rip)\n\n```\n\n```armasm\n; <pre-target>\n\t.cfi_startproc\n; %bb.0:\n\tsub\tsp, sp, #320\n\t.cfi_def_cfa_offset 320\n\tstp\tx28, x27, [sp, #288] ; 16-byte Folded Spill\n\tstp\tx29, x30, [sp, #304] ; 16-byte Folded Spill\n\tadd\tx29, sp, #304\n\t.cfi_def_cfa w29, 16\n\t.cfi_offset w30, -8\n\t.cfi_offset w29, -16\n\t.cfi_offset w27, -24\n\t.cfi_offset w28, -32\n\tadrp\tx8, _pgBufferUsage@GOTPAGE\n\tldr\tx8, [x8, _pgBufferUsage@GOTPAGEOFF]\n\tstr\tx8, [sp, #24] ; 8-byte Folded Spill\n\tadrp\tx8, _nested_level@GOTPAGE\n\tldr\tx8, [x8, _nested_level@GOTPAGEOFF]\n\tstr\tx8, [sp, #32] ; 8-byte Folded Spill\n\tstur\tx0, [x29, #-24]\n\tstur\tx1, [x29, #-32]\n\tstur\tw2, [x29, #-36]\n\tstur\tw3, [x29, #-40]\n\tstur\tx4, [x29, #-48]\n\tstur\tx5, [x29, #-56]\n\tstur\tx6, [x29, #-64]\n\tldur\tx8, [x29, #-24]\n\tldr\tx8, [x8, #8]\n\tstur\tx8, [x29, #-72]\n\tadrp\tx8, _pgss_track_utility@GOTPAGE\n\tldr\tx8, [x8, _pgss_track_utility@GOTPAGEOFF]\n\tldr\tx8, [x8]\n\tsubs\tx8, x8, #0\n\tcset\tw8, eq\n\ttbnz\tw8, #0, LBB0_13\n\tb\tLBB0_1\nLBB0_1:\n\tbl\t_pgss_enabled\n\tsubs\tx8, x0, #0\n\tcset\tw8, eq\n\ttbnz\tw8, #0, LBB0_13\n\tb\tLBB0_2\nLBB0_2:\n\tldur\tx0, [x29, #-72]\n\tadrp\tx8, _ExecuteStmt@GOTPAGE\n\tldr\tx8, [x8, _ExecuteStmt@GOTPAGEOFF]\n\n```", "role": "user" }, { "content": "```armasm\n\tldr\tw1, [x8]\n\tbl\t_IsA\n\tsubs\tw8, w0, #0\n\tcset\tw8, ne\n\ttbnz\tw8, #0, LBB0_13\n\tb\tLBB0_3\nLBB0_3:\n\tldur\tx0, [x29, #-72]\n\tadrp\tx8, _PrepareStmt@GOTPAGE\n\tldr\tx8, [x8, _PrepareStmt@GOTPAGEOFF]\n\tldr\tw1, [x8]\n\tbl\t_IsA\n\tsubs\tw8, w0, #0\n\tcset\tw8, ne\n\ttbnz\tw8, #0, LBB0_13\n\tb\tLBB0_4\nLBB0_4:\n\tldur\tx0, [x29, #-72]\n\tadrp\tx8, _DeallocateStmt@GOTPAGE\n\tldr\tx8, [x8, _DeallocateStmt@GOTPAGEOFF]\n\tldr\tw1, [x8]\n\tbl\t_IsA\n\tsubs\tw8, w0, #0\n\tcset\tw8, ne\n```", "role": "assistant" } ]
extr_pg_stat_statements.c_pgss_ProcessUtility.c
[ { "content": "You are given an x86 assembly block (<block>) to traspile into armv8_64 assembly.\nYou are also given the context for this block in the form of pre-context (<pre_context>) and post-context (<post_context>).\nThere is also a pre-target-context (<pre_target>) which is the context for the target block. Use the input pre and post context along with the target pre context to transpile the block from x86 to armv8_64.\n\n```x86asm\n; <pre-context>\n\tcallq\tIsA@PLT\n\tcmpl\t$0, %eax\n\tjne\t.LBB0_13\n# %bb.4:\n\tmovq\t-48(%rbp), %rdi\n\tmovl\tDeallocateStmt(%rip), %esi\n\tcallq\tIsA@PLT\n\tcmpl\t$0, %eax\n\n; <block>\n\tjne\t.LBB0_13\n# %bb.5:\n\tleaq\t-152(%rbp), %rdi\n\tleaq\tpgBufferUsage(%rip), %rsi\n\tmovl\t$88, %edx\n\tcallq\tmemcpy@PLT\n\tmovl\t-52(%rbp), %edi\n\tcallq\tINSTR_TIME_SET_CURRENT@PLT\n\tmovl\tnested_level(%rip), %eax\n\taddl\t$1, %eax\n\tmovl\t%eax, nested_level(%rip)\n\tmovb\t$0, %al\n\tcallq\tPG_TRY@PLT\n\tmovb\t$1, %al\n\ttestb\t$1, %al\n\tjne\t.LBB0_6\n\tjmp\t.LBB0_7\n.LBB0_6:\n\tmovq\t-8(%rbp), %rdi\n\tmovq\t-16(%rbp), %rsi\n\tmovl\t-20(%rbp), %edx\n\n; <post-context>\n\tmovl\t-24(%rbp), %ecx\n\tmovq\t-32(%rbp), %r8\n\tmovq\t-40(%rbp), %r9\n\tmovq\t16(%rbp), %rax\n\tmovq\t%rax, (%rsp)\n\tcallq\tprev_ProcessUtility@PLT\n\tjmp\t.LBB0_8\n.LBB0_7:\n\n```\n\n```armasm\n; <pre-target>\n\t.cfi_startproc\n; %bb.0:\n\tsub\tsp, sp, #320\n\t.cfi_def_cfa_offset 320\n\tstp\tx28, x27, [sp, #288] ; 16-byte Folded Spill\n\tstp\tx29, x30, [sp, #304] ; 16-byte Folded Spill\n\tadd\tx29, sp, #304\n\t.cfi_def_cfa w29, 16\n\t.cfi_offset w30, -8\n\t.cfi_offset w29, -16\n\t.cfi_offset w27, -24\n\t.cfi_offset w28, -32\n\tadrp\tx8, _pgBufferUsage@GOTPAGE\n\tldr\tx8, [x8, _pgBufferUsage@GOTPAGEOFF]\n\tstr\tx8, [sp, #24] ; 8-byte Folded Spill\n\tadrp\tx8, _nested_level@GOTPAGE\n\tldr\tx8, [x8, _nested_level@GOTPAGEOFF]\n\tstr\tx8, [sp, #32] ; 8-byte Folded Spill\n\tstur\tx0, [x29, #-24]\n\tstur\tx1, [x29, #-32]\n\tstur\tw2, [x29, #-36]\n\tstur\tw3, [x29, #-40]\n\tstur\tx4, [x29, #-48]\n\tstur\tx5, [x29, #-56]\n\tstur\tx6, [x29, #-64]\n\tldur\tx8, [x29, #-24]\n\tldr\tx8, [x8, #8]\n\tstur\tx8, [x29, #-72]\n\tadrp\tx8, _pgss_track_utility@GOTPAGE\n\tldr\tx8, [x8, _pgss_track_utility@GOTPAGEOFF]\n\tldr\tx8, [x8]\n\tsubs\tx8, x8, #0\n\tcset\tw8, eq\n\ttbnz\tw8, #0, LBB0_13\n\tb\tLBB0_1\nLBB0_1:\n\tbl\t_pgss_enabled\n\tsubs\tx8, x0, #0\n\tcset\tw8, eq\n\ttbnz\tw8, #0, LBB0_13\n\tb\tLBB0_2\nLBB0_2:\n\tldur\tx0, [x29, #-72]\n\tadrp\tx8, _ExecuteStmt@GOTPAGE\n\tldr\tx8, [x8, _ExecuteStmt@GOTPAGEOFF]\n\tldr\tw1, [x8]\n\tbl\t_IsA\n\tsubs\tw8, w0, #0\n\tcset\tw8, ne\n\ttbnz\tw8, #0, LBB0_13\n\tb\tLBB0_3\nLBB0_3:\n\tldur\tx0, [x29, #-72]\n\tadrp\tx8, _PrepareStmt@GOTPAGE\n\tldr\tx8, [x8, _PrepareStmt@GOTPAGEOFF]\n\tldr\tw1, [x8]\n\tbl\t_IsA\n\tsubs\tw8, w0, #0\n\tcset\tw8, ne\n\ttbnz\tw8, #0, LBB0_13\n\tb\tLBB0_4\nLBB0_4:\n\tldur\tx0, [x29, #-72]\n\tadrp\tx8, _DeallocateStmt@GOTPAGE\n\tldr\tx8, [x8, _DeallocateStmt@GOTPAGEOFF]\n\tldr\tw1, [x8]\n\tbl\t_IsA\n\tsubs\tw8, w0, #0\n\tcset\tw8, ne\n\n```", "role": "user" }, { "content": "```armasm\n\ttbnz\tw8, #0, LBB0_13\n\tb\tLBB0_5\nLBB0_5:\n\tldr\tx1, [sp, #24] ; 8-byte Folded Reload\n\tadd\tx0, sp, #128\n\tmov\tx2, #88\n\tbl\t_memcpy\n\tldur\tw0, [x29, #-76]\n\tbl\t_INSTR_TIME_SET_CURRENT\n\tldr\tx9, [sp, #32] ; 8-byte Folded Reload\n\tldr\tw8, [x9]\n\tadd\tw8, w8, #1\n\tstr\tw8, [x9]\n\tbl\t_PG_TRY\n\tmov\tw8, #1\n\ttbz\tw8, #0, LBB0_7\n\tb\tLBB0_6\nLBB0_6:\n\tldur\tx0, [x29, #-24]\n\tldur\tx1, [x29, #-32]\n\tldur\tw2, [x29, #-36]\n```", "role": "assistant" } ]
extr_pg_stat_statements.c_pgss_ProcessUtility.c
[ { "content": "You are given an x86 assembly block (<block>) to traspile into armv8_64 assembly.\nYou are also given the context for this block in the form of pre-context (<pre_context>) and post-context (<post_context>).\nThere is also a pre-target-context (<pre_target>) which is the context for the target block. Use the input pre and post context along with the target pre context to transpile the block from x86 to armv8_64.\n\n```x86asm\n; <pre-context>\n\tmovb\t$0, %al\n\tcallq\tPG_TRY@PLT\n\tmovb\t$1, %al\n\ttestb\t$1, %al\n\tjne\t.LBB0_6\n\tjmp\t.LBB0_7\n.LBB0_6:\n\tmovq\t-8(%rbp), %rdi\n\tmovq\t-16(%rbp), %rsi\n\tmovl\t-20(%rbp), %edx\n\n; <block>\n\tmovl\t-24(%rbp), %ecx\n\tmovq\t-32(%rbp), %r8\n\tmovq\t-40(%rbp), %r9\n\tmovq\t16(%rbp), %rax\n\tmovq\t%rax, (%rsp)\n\tcallq\tprev_ProcessUtility@PLT\n\tjmp\t.LBB0_8\n.LBB0_7:\n\tmovq\t-8(%rbp), %rdi\n\tmovq\t-16(%rbp), %rsi\n\tmovl\t-20(%rbp), %edx\n\tmovl\t-24(%rbp), %ecx\n\tmovq\t-32(%rbp), %r8\n\n; <post-context>\n\tmovq\t-40(%rbp), %r9\n\tmovq\t16(%rbp), %rax\n\tmovq\t%rax, (%rsp)\n\tcallq\tstandard_ProcessUtility@PLT\n.LBB0_8:\n\tmovb\t$0, %al\n\tcallq\tPG_FINALLY@PLT\n\tmovl\tnested_level(%rip), %eax\n\taddl\t$-1, %eax\n\tmovl\t%eax, nested_level(%rip)\n\n```\n\n```armasm\n; <pre-target>\n\t.cfi_startproc\n; %bb.0:\n\tsub\tsp, sp, #320\n\t.cfi_def_cfa_offset 320\n\tstp\tx28, x27, [sp, #288] ; 16-byte Folded Spill\n\tstp\tx29, x30, [sp, #304] ; 16-byte Folded Spill\n\tadd\tx29, sp, #304\n\t.cfi_def_cfa w29, 16\n\t.cfi_offset w30, -8\n\t.cfi_offset w29, -16\n\t.cfi_offset w27, -24\n\t.cfi_offset w28, -32\n\tadrp\tx8, _pgBufferUsage@GOTPAGE\n\tldr\tx8, [x8, _pgBufferUsage@GOTPAGEOFF]\n\tstr\tx8, [sp, #24] ; 8-byte Folded Spill\n\tadrp\tx8, _nested_level@GOTPAGE\n\tldr\tx8, [x8, _nested_level@GOTPAGEOFF]\n\tstr\tx8, [sp, #32] ; 8-byte Folded Spill\n\tstur\tx0, [x29, #-24]\n\tstur\tx1, [x29, #-32]\n\tstur\tw2, [x29, #-36]\n\tstur\tw3, [x29, #-40]\n\tstur\tx4, [x29, #-48]\n\tstur\tx5, [x29, #-56]\n\tstur\tx6, [x29, #-64]\n\tldur\tx8, [x29, #-24]\n\tldr\tx8, [x8, #8]\n\tstur\tx8, [x29, #-72]\n\tadrp\tx8, _pgss_track_utility@GOTPAGE\n\tldr\tx8, [x8, _pgss_track_utility@GOTPAGEOFF]\n\tldr\tx8, [x8]\n\tsubs\tx8, x8, #0\n\tcset\tw8, eq\n\ttbnz\tw8, #0, LBB0_13\n\tb\tLBB0_1\nLBB0_1:\n\tbl\t_pgss_enabled\n\tsubs\tx8, x0, #0\n\tcset\tw8, eq\n\ttbnz\tw8, #0, LBB0_13\n\tb\tLBB0_2\nLBB0_2:\n\tldur\tx0, [x29, #-72]\n\tadrp\tx8, _ExecuteStmt@GOTPAGE\n\tldr\tx8, [x8, _ExecuteStmt@GOTPAGEOFF]\n\tldr\tw1, [x8]\n\tbl\t_IsA\n\tsubs\tw8, w0, #0\n\tcset\tw8, ne\n\ttbnz\tw8, #0, LBB0_13\n\tb\tLBB0_3\nLBB0_3:\n\tldur\tx0, [x29, #-72]\n\tadrp\tx8, _PrepareStmt@GOTPAGE\n\tldr\tx8, [x8, _PrepareStmt@GOTPAGEOFF]\n\tldr\tw1, [x8]\n\tbl\t_IsA\n\tsubs\tw8, w0, #0\n\tcset\tw8, ne\n\ttbnz\tw8, #0, LBB0_13\n\tb\tLBB0_4\nLBB0_4:\n\tldur\tx0, [x29, #-72]\n\tadrp\tx8, _DeallocateStmt@GOTPAGE\n\tldr\tx8, [x8, _DeallocateStmt@GOTPAGEOFF]\n\tldr\tw1, [x8]\n\tbl\t_IsA\n\tsubs\tw8, w0, #0\n\tcset\tw8, ne\n\ttbnz\tw8, #0, LBB0_13\n\tb\tLBB0_5\nLBB0_5:\n\tldr\tx1, [sp, #24] ; 8-byte Folded Reload\n\tadd\tx0, sp, #128\n\tmov\tx2, #88\n\tbl\t_memcpy\n\tldur\tw0, [x29, #-76]\n\tbl\t_INSTR_TIME_SET_CURRENT\n\tldr\tx9, [sp, #32] ; 8-byte Folded Reload\n\tldr\tw8, [x9]\n\tadd\tw8, w8, #1\n\tstr\tw8, [x9]\n\tbl\t_PG_TRY\n\tmov\tw8, #1\n\ttbz\tw8, #0, LBB0_7\n\tb\tLBB0_6\nLBB0_6:\n\tldur\tx0, [x29, #-24]\n\tldur\tx1, [x29, #-32]\n\tldur\tw2, [x29, #-36]\n\n```", "role": "user" }, { "content": "```armasm\n\tldur\tw3, [x29, #-40]\n\tldur\tx4, [x29, #-48]\n\tldur\tx5, [x29, #-56]\n\tldur\tx6, [x29, #-64]\n\tbl\t_prev_ProcessUtility\n\tb\tLBB0_8\nLBB0_7:\n\tldur\tx0, [x29, #-24]\n\tldur\tx1, [x29, #-32]\n\tldur\tw2, [x29, #-36]\n\tldur\tw3, [x29, #-40]\n\tldur\tx4, [x29, #-48]\n```", "role": "assistant" } ]
extr_pg_stat_statements.c_pgss_ProcessUtility.c
[ { "content": "You are given an x86 assembly block (<block>) to traspile into armv8_64 assembly.\nYou are also given the context for this block in the form of pre-context (<pre_context>) and post-context (<post_context>).\nThere is also a pre-target-context (<pre_target>) which is the context for the target block. Use the input pre and post context along with the target pre context to transpile the block from x86 to armv8_64.\n\n```x86asm\n; <pre-context>\n\tmovq\t-8(%rbp), %rdi\n\tmovq\t-16(%rbp), %rsi\n\tmovl\t-20(%rbp), %edx\n\tmovl\t-24(%rbp), %ecx\n\tmovq\t-32(%rbp), %r8\n\n; <block>\n\tmovq\t-40(%rbp), %r9\n\tmovq\t16(%rbp), %rax\n\tmovq\t%rax, (%rsp)\n\tcallq\tstandard_ProcessUtility@PLT\n.LBB0_8:\n\tmovb\t$0, %al\n\tcallq\tPG_FINALLY@PLT\n\tmovl\tnested_level(%rip), %eax\n\taddl\t$-1, %eax\n\tmovl\t%eax, nested_level(%rip)\n\tmovb\t$0, %al\n\tcallq\tPG_END_TRY@PLT\n\tmovl\t-56(%rbp), %edi\n\tcallq\tINSTR_TIME_SET_CURRENT@PLT\n\tmovl\t-56(%rbp), %edi\n\tmovl\t-52(%rbp), %esi\n\n; <post-context>\n\tcallq\tINSTR_TIME_SUBTRACT@PLT\n\tcmpq\t$0, 16(%rbp)\n\tje\t.LBB0_11\n# %bb.9:\n\tmovq\t16(%rbp), %rdi\n\tleaq\t.L.str(%rip), %rsi\n\tmovl\t$5, %edx\n\tcallq\tstrncmp@PLT\n\n```\n\n```armasm\n; <pre-target>\n\t.cfi_startproc\n; %bb.0:\n\tsub\tsp, sp, #320\n\t.cfi_def_cfa_offset 320\n\tstp\tx28, x27, [sp, #288] ; 16-byte Folded Spill\n\tstp\tx29, x30, [sp, #304] ; 16-byte Folded Spill\n\tadd\tx29, sp, #304\n\t.cfi_def_cfa w29, 16\n\t.cfi_offset w30, -8\n\t.cfi_offset w29, -16\n\t.cfi_offset w27, -24\n\t.cfi_offset w28, -32\n\tadrp\tx8, _pgBufferUsage@GOTPAGE\n\tldr\tx8, [x8, _pgBufferUsage@GOTPAGEOFF]\n\tstr\tx8, [sp, #24] ; 8-byte Folded Spill\n\tadrp\tx8, _nested_level@GOTPAGE\n\tldr\tx8, [x8, _nested_level@GOTPAGEOFF]\n\tstr\tx8, [sp, #32] ; 8-byte Folded Spill\n\tstur\tx0, [x29, #-24]\n\tstur\tx1, [x29, #-32]\n\tstur\tw2, [x29, #-36]\n\tstur\tw3, [x29, #-40]\n\tstur\tx4, [x29, #-48]\n\tstur\tx5, [x29, #-56]\n\tstur\tx6, [x29, #-64]\n\tldur\tx8, [x29, #-24]\n\tldr\tx8, [x8, #8]\n\tstur\tx8, [x29, #-72]\n\tadrp\tx8, _pgss_track_utility@GOTPAGE\n\tldr\tx8, [x8, _pgss_track_utility@GOTPAGEOFF]\n\tldr\tx8, [x8]\n\tsubs\tx8, x8, #0\n\tcset\tw8, eq\n\ttbnz\tw8, #0, LBB0_13\n\tb\tLBB0_1\nLBB0_1:\n\tbl\t_pgss_enabled\n\tsubs\tx8, x0, #0\n\tcset\tw8, eq\n\ttbnz\tw8, #0, LBB0_13\n\tb\tLBB0_2\nLBB0_2:\n\tldur\tx0, [x29, #-72]\n\tadrp\tx8, _ExecuteStmt@GOTPAGE\n\tldr\tx8, [x8, _ExecuteStmt@GOTPAGEOFF]\n\tldr\tw1, [x8]\n\tbl\t_IsA\n\tsubs\tw8, w0, #0\n\tcset\tw8, ne\n\ttbnz\tw8, #0, LBB0_13\n\tb\tLBB0_3\nLBB0_3:\n\tldur\tx0, [x29, #-72]\n\tadrp\tx8, _PrepareStmt@GOTPAGE\n\tldr\tx8, [x8, _PrepareStmt@GOTPAGEOFF]\n\tldr\tw1, [x8]\n\tbl\t_IsA\n\tsubs\tw8, w0, #0\n\tcset\tw8, ne\n\ttbnz\tw8, #0, LBB0_13\n\tb\tLBB0_4\nLBB0_4:\n\tldur\tx0, [x29, #-72]\n\tadrp\tx8, _DeallocateStmt@GOTPAGE\n\tldr\tx8, [x8, _DeallocateStmt@GOTPAGEOFF]\n\tldr\tw1, [x8]\n\tbl\t_IsA\n\tsubs\tw8, w0, #0\n\tcset\tw8, ne\n\ttbnz\tw8, #0, LBB0_13\n\tb\tLBB0_5\nLBB0_5:\n\tldr\tx1, [sp, #24] ; 8-byte Folded Reload\n\tadd\tx0, sp, #128\n\tmov\tx2, #88\n\tbl\t_memcpy\n\tldur\tw0, [x29, #-76]\n\tbl\t_INSTR_TIME_SET_CURRENT\n\tldr\tx9, [sp, #32] ; 8-byte Folded Reload\n\tldr\tw8, [x9]\n\tadd\tw8, w8, #1\n\tstr\tw8, [x9]\n\tbl\t_PG_TRY\n\tmov\tw8, #1\n\ttbz\tw8, #0, LBB0_7\n\tb\tLBB0_6\nLBB0_6:\n\tldur\tx0, [x29, #-24]\n\tldur\tx1, [x29, #-32]\n\tldur\tw2, [x29, #-36]\n\tldur\tw3, [x29, #-40]\n\tldur\tx4, [x29, #-48]\n\tldur\tx5, [x29, #-56]\n\tldur\tx6, [x29, #-64]\n\tbl\t_prev_ProcessUtility\n\tb\tLBB0_8\nLBB0_7:\n\tldur\tx0, [x29, #-24]\n\tldur\tx1, [x29, #-32]\n\tldur\tw2, [x29, #-36]\n\tldur\tw3, [x29, #-40]\n\tldur\tx4, [x29, #-48]\n\n```", "role": "user" }, { "content": "```armasm\n\tldur\tx5, [x29, #-56]\n\tldur\tx6, [x29, #-64]\n\tbl\t_standard_ProcessUtility\n\tb\tLBB0_8\nLBB0_8:\n\tbl\t_PG_FINALLY\n\tldr\tx9, [sp, #32] ; 8-byte Folded Reload\n\tldr\tw8, [x9]\n\tsubs\tw8, w8, #1\n\tstr\tw8, [x9]\n\tbl\t_PG_END_TRY\n\tldur\tw0, [x29, #-80]\n\tbl\t_INSTR_TIME_SET_CURRENT\n\tldur\tw0, [x29, #-80]\n\tldur\tw1, [x29, #-76]\n```", "role": "assistant" } ]
extr_pg_stat_statements.c_pgss_ProcessUtility.c
[ { "content": "You are given an x86 assembly block (<block>) to traspile into armv8_64 assembly.\nYou are also given the context for this block in the form of pre-context (<pre_context>) and post-context (<post_context>).\nThere is also a pre-target-context (<pre_target>) which is the context for the target block. Use the input pre and post context along with the target pre context to transpile the block from x86 to armv8_64.\n\n```x86asm\n; <pre-context>\n\tmovb\t$0, %al\n\tcallq\tPG_END_TRY@PLT\n\tmovl\t-56(%rbp), %edi\n\tcallq\tINSTR_TIME_SET_CURRENT@PLT\n\tmovl\t-56(%rbp), %edi\n\tmovl\t-52(%rbp), %esi\n\n; <block>\n\tcallq\tINSTR_TIME_SUBTRACT@PLT\n\tcmpq\t$0, 16(%rbp)\n\tje\t.LBB0_11\n# %bb.9:\n\tmovq\t16(%rbp), %rdi\n\tleaq\t.L.str(%rip), %rsi\n\tmovl\t$5, %edx\n\tcallq\tstrncmp@PLT\n\tcmpq\t$0, %rax\n\tjne\t.LBB0_11\n# %bb.10:\n\tmovq\t16(%rbp), %rdi\n\taddq\t$5, %rdi\n\txorl\t%eax, %eax\n\tmovl\t%eax, %esi\n\tmovl\t$10, %edx\n\tcallq\tpg_strtouint64@PLT\n\n; <post-context>\n\tmovq\t%rax, -64(%rbp)\n\tjmp\t.LBB0_12\n.LBB0_11:\n\tmovq\t$0, -64(%rbp)\n.LBB0_12:\n\tmovq\tpgBufferUsage+80(%rip), %rax\n\tsubq\t-72(%rbp), %rax\n\n```\n\n```armasm\n; <pre-target>\n\t.cfi_startproc\n; %bb.0:\n\tsub\tsp, sp, #320\n\t.cfi_def_cfa_offset 320\n\tstp\tx28, x27, [sp, #288] ; 16-byte Folded Spill\n\tstp\tx29, x30, [sp, #304] ; 16-byte Folded Spill\n\tadd\tx29, sp, #304\n\t.cfi_def_cfa w29, 16\n\t.cfi_offset w30, -8\n\t.cfi_offset w29, -16\n\t.cfi_offset w27, -24\n\t.cfi_offset w28, -32\n\tadrp\tx8, _pgBufferUsage@GOTPAGE\n\tldr\tx8, [x8, _pgBufferUsage@GOTPAGEOFF]\n\tstr\tx8, [sp, #24] ; 8-byte Folded Spill\n\tadrp\tx8, _nested_level@GOTPAGE\n\tldr\tx8, [x8, _nested_level@GOTPAGEOFF]\n\tstr\tx8, [sp, #32] ; 8-byte Folded Spill\n\tstur\tx0, [x29, #-24]\n\tstur\tx1, [x29, #-32]\n\tstur\tw2, [x29, #-36]\n\tstur\tw3, [x29, #-40]\n\tstur\tx4, [x29, #-48]\n\tstur\tx5, [x29, #-56]\n\tstur\tx6, [x29, #-64]\n\tldur\tx8, [x29, #-24]\n\tldr\tx8, [x8, #8]\n\tstur\tx8, [x29, #-72]\n\tadrp\tx8, _pgss_track_utility@GOTPAGE\n\tldr\tx8, [x8, _pgss_track_utility@GOTPAGEOFF]\n\tldr\tx8, [x8]\n\tsubs\tx8, x8, #0\n\tcset\tw8, eq\n\ttbnz\tw8, #0, LBB0_13\n\tb\tLBB0_1\nLBB0_1:\n\tbl\t_pgss_enabled\n\tsubs\tx8, x0, #0\n\tcset\tw8, eq\n\ttbnz\tw8, #0, LBB0_13\n\tb\tLBB0_2\nLBB0_2:\n\tldur\tx0, [x29, #-72]\n\tadrp\tx8, _ExecuteStmt@GOTPAGE\n\tldr\tx8, [x8, _ExecuteStmt@GOTPAGEOFF]\n\tldr\tw1, [x8]\n\tbl\t_IsA\n\tsubs\tw8, w0, #0\n\tcset\tw8, ne\n\ttbnz\tw8, #0, LBB0_13\n\tb\tLBB0_3\nLBB0_3:\n\tldur\tx0, [x29, #-72]\n\tadrp\tx8, _PrepareStmt@GOTPAGE\n\tldr\tx8, [x8, _PrepareStmt@GOTPAGEOFF]\n\tldr\tw1, [x8]\n\tbl\t_IsA\n\tsubs\tw8, w0, #0\n\tcset\tw8, ne\n\ttbnz\tw8, #0, LBB0_13\n\tb\tLBB0_4\nLBB0_4:\n\tldur\tx0, [x29, #-72]\n\tadrp\tx8, _DeallocateStmt@GOTPAGE\n\tldr\tx8, [x8, _DeallocateStmt@GOTPAGEOFF]\n\tldr\tw1, [x8]\n\tbl\t_IsA\n\tsubs\tw8, w0, #0\n\tcset\tw8, ne\n\ttbnz\tw8, #0, LBB0_13\n\tb\tLBB0_5\nLBB0_5:\n\tldr\tx1, [sp, #24] ; 8-byte Folded Reload\n\tadd\tx0, sp, #128\n\tmov\tx2, #88\n\tbl\t_memcpy\n\tldur\tw0, [x29, #-76]\n\tbl\t_INSTR_TIME_SET_CURRENT\n\tldr\tx9, [sp, #32] ; 8-byte Folded Reload\n\tldr\tw8, [x9]\n\tadd\tw8, w8, #1\n\tstr\tw8, [x9]\n\tbl\t_PG_TRY\n\tmov\tw8, #1\n\ttbz\tw8, #0, LBB0_7\n\tb\tLBB0_6\nLBB0_6:\n\tldur\tx0, [x29, #-24]\n\tldur\tx1, [x29, #-32]\n\tldur\tw2, [x29, #-36]\n\tldur\tw3, [x29, #-40]\n\tldur\tx4, [x29, #-48]\n\tldur\tx5, [x29, #-56]\n\tldur\tx6, [x29, #-64]\n\tbl\t_prev_ProcessUtility\n\tb\tLBB0_8\nLBB0_7:\n\tldur\tx0, [x29, #-24]\n\tldur\tx1, [x29, #-32]\n\tldur\tw2, [x29, #-36]\n\tldur\tw3, [x29, #-40]\n\tldur\tx4, [x29, #-48]\n\tldur\tx5, [x29, #-56]\n\tldur\tx6, [x29, #-64]\n\tbl\t_standard_ProcessUtility\n\tb\tLBB0_8\nLBB0_8:\n\tbl\t_PG_FINALLY\n\tldr\tx9, [sp, #32] ; 8-byte Folded Reload\n\tldr\tw8, [x9]\n\tsubs\tw8, w8, #1\n\tstr\tw8, [x9]\n\tbl\t_PG_END_TRY\n\tldur\tw0, [x29, #-80]\n\tbl\t_INSTR_TIME_SET_CURRENT\n\tldur\tw0, [x29, #-80]\n\tldur\tw1, [x29, #-76]\n\n```", "role": "user" }, { "content": "```armasm\n\tbl\t_INSTR_TIME_SUBTRACT\n\tldur\tx8, [x29, #-64]\n\tsubs\tx8, x8, #0\n\tcset\tw8, eq\n\ttbnz\tw8, #0, LBB0_11\n\tb\tLBB0_9\nLBB0_9:\n\tldur\tx0, [x29, #-64]\n\tadrp\tx1, l_.str@PAGE\n\tadd\tx1, x1, l_.str@PAGEOFF\n\tmov\tw2, #5\n\tbl\t_strncmp\n\tsubs\tx8, x0, #0\n\tcset\tw8, ne\n\ttbnz\tw8, #0, LBB0_11\n\tb\tLBB0_10\nLBB0_10:\n\tldur\tx8, [x29, #-64]\n\tadd\tx0, x8, #5\n\tmov\tx1, #0\n\tmov\tw2, #10\n\tbl\t_pg_strtouint64\n```", "role": "assistant" } ]
extr_pg_stat_statements.c_pgss_ProcessUtility.c
[ { "content": "You are given an x86 assembly block (<block>) to traspile into armv8_64 assembly.\nYou are also given the context for this block in the form of pre-context (<pre_context>) and post-context (<post_context>).\nThere is also a pre-target-context (<pre_target>) which is the context for the target block. Use the input pre and post context along with the target pre context to transpile the block from x86 to armv8_64.\n\n```x86asm\n; <pre-context>\n\tcmpq\t$0, %rax\n\tjne\t.LBB0_11\n# %bb.10:\n\tmovq\t16(%rbp), %rdi\n\taddq\t$5, %rdi\n\txorl\t%eax, %eax\n\tmovl\t%eax, %esi\n\tmovl\t$10, %edx\n\tcallq\tpg_strtouint64@PLT\n\n; <block>\n\tmovq\t%rax, -64(%rbp)\n\tjmp\t.LBB0_12\n.LBB0_11:\n\tmovq\t$0, -64(%rbp)\n.LBB0_12:\n\tmovq\tpgBufferUsage+80(%rip), %rax\n\tsubq\t-72(%rbp), %rax\n\tmovq\t%rax, -160(%rbp)\n\tmovq\tpgBufferUsage+72(%rip), %rax\n\tsubq\t-80(%rbp), %rax\n\tmovq\t%rax, -168(%rbp)\n\tmovq\tpgBufferUsage+64(%rip), %rax\n\n; <post-context>\n\tsubq\t-88(%rbp), %rax\n\tmovq\t%rax, -176(%rbp)\n\tmovq\tpgBufferUsage+56(%rip), %rax\n\tsubq\t-96(%rbp), %rax\n\tmovq\t%rax, -184(%rbp)\n\n```\n\n```armasm\n; <pre-target>\n\t.cfi_startproc\n; %bb.0:\n\tsub\tsp, sp, #320\n\t.cfi_def_cfa_offset 320\n\tstp\tx28, x27, [sp, #288] ; 16-byte Folded Spill\n\tstp\tx29, x30, [sp, #304] ; 16-byte Folded Spill\n\tadd\tx29, sp, #304\n\t.cfi_def_cfa w29, 16\n\t.cfi_offset w30, -8\n\t.cfi_offset w29, -16\n\t.cfi_offset w27, -24\n\t.cfi_offset w28, -32\n\tadrp\tx8, _pgBufferUsage@GOTPAGE\n\tldr\tx8, [x8, _pgBufferUsage@GOTPAGEOFF]\n\tstr\tx8, [sp, #24] ; 8-byte Folded Spill\n\tadrp\tx8, _nested_level@GOTPAGE\n\tldr\tx8, [x8, _nested_level@GOTPAGEOFF]\n\tstr\tx8, [sp, #32] ; 8-byte Folded Spill\n\tstur\tx0, [x29, #-24]\n\tstur\tx1, [x29, #-32]\n\tstur\tw2, [x29, #-36]\n\tstur\tw3, [x29, #-40]\n\tstur\tx4, [x29, #-48]\n\tstur\tx5, [x29, #-56]\n\tstur\tx6, [x29, #-64]\n\tldur\tx8, [x29, #-24]\n\tldr\tx8, [x8, #8]\n\tstur\tx8, [x29, #-72]\n\tadrp\tx8, _pgss_track_utility@GOTPAGE\n\tldr\tx8, [x8, _pgss_track_utility@GOTPAGEOFF]\n\tldr\tx8, [x8]\n\tsubs\tx8, x8, #0\n\tcset\tw8, eq\n\ttbnz\tw8, #0, LBB0_13\n\tb\tLBB0_1\nLBB0_1:\n\tbl\t_pgss_enabled\n\tsubs\tx8, x0, #0\n\tcset\tw8, eq\n\ttbnz\tw8, #0, LBB0_13\n\tb\tLBB0_2\nLBB0_2:\n\tldur\tx0, [x29, #-72]\n\tadrp\tx8, _ExecuteStmt@GOTPAGE\n\tldr\tx8, [x8, _ExecuteStmt@GOTPAGEOFF]\n\tldr\tw1, [x8]\n\tbl\t_IsA\n\tsubs\tw8, w0, #0\n\tcset\tw8, ne\n\ttbnz\tw8, #0, LBB0_13\n\tb\tLBB0_3\nLBB0_3:\n\tldur\tx0, [x29, #-72]\n\tadrp\tx8, _PrepareStmt@GOTPAGE\n\tldr\tx8, [x8, _PrepareStmt@GOTPAGEOFF]\n\tldr\tw1, [x8]\n\tbl\t_IsA\n\tsubs\tw8, w0, #0\n\tcset\tw8, ne\n\ttbnz\tw8, #0, LBB0_13\n\tb\tLBB0_4\nLBB0_4:\n\tldur\tx0, [x29, #-72]\n\tadrp\tx8, _DeallocateStmt@GOTPAGE\n\tldr\tx8, [x8, _DeallocateStmt@GOTPAGEOFF]\n\tldr\tw1, [x8]\n\tbl\t_IsA\n\tsubs\tw8, w0, #0\n\tcset\tw8, ne\n\ttbnz\tw8, #0, LBB0_13\n\tb\tLBB0_5\nLBB0_5:\n\tldr\tx1, [sp, #24] ; 8-byte Folded Reload\n\tadd\tx0, sp, #128\n\tmov\tx2, #88\n\tbl\t_memcpy\n\tldur\tw0, [x29, #-76]\n\tbl\t_INSTR_TIME_SET_CURRENT\n\tldr\tx9, [sp, #32] ; 8-byte Folded Reload\n\tldr\tw8, [x9]\n\tadd\tw8, w8, #1\n\tstr\tw8, [x9]\n\tbl\t_PG_TRY\n\tmov\tw8, #1\n\ttbz\tw8, #0, LBB0_7\n\tb\tLBB0_6\nLBB0_6:\n\tldur\tx0, [x29, #-24]\n\tldur\tx1, [x29, #-32]\n\tldur\tw2, [x29, #-36]\n\tldur\tw3, [x29, #-40]\n\tldur\tx4, [x29, #-48]\n\tldur\tx5, [x29, #-56]\n\tldur\tx6, [x29, #-64]\n\tbl\t_prev_ProcessUtility\n\tb\tLBB0_8\nLBB0_7:\n\tldur\tx0, [x29, #-24]\n\tldur\tx1, [x29, #-32]\n\tldur\tw2, [x29, #-36]\n\tldur\tw3, [x29, #-40]\n\tldur\tx4, [x29, #-48]\n\tldur\tx5, [x29, #-56]\n\tldur\tx6, [x29, #-64]\n\tbl\t_standard_ProcessUtility\n\tb\tLBB0_8\nLBB0_8:\n\tbl\t_PG_FINALLY\n\tldr\tx9, [sp, #32] ; 8-byte Folded Reload\n\tldr\tw8, [x9]\n\tsubs\tw8, w8, #1\n\tstr\tw8, [x9]\n\tbl\t_PG_END_TRY\n\tldur\tw0, [x29, #-80]\n\tbl\t_INSTR_TIME_SET_CURRENT\n\tldur\tw0, [x29, #-80]\n\tldur\tw1, [x29, #-76]\n\tbl\t_INSTR_TIME_SUBTRACT\n\tldur\tx8, [x29, #-64]\n\tsubs\tx8, x8, #0\n\tcset\tw8, eq\n\ttbnz\tw8, #0, LBB0_11\n\tb\tLBB0_9\nLBB0_9:\n\tldur\tx0, [x29, #-64]\n\tadrp\tx1, l_.str@PAGE\n\tadd\tx1, x1, l_.str@PAGEOFF\n\tmov\tw2, #5\n\tbl\t_strncmp\n\tsubs\tx8, x0, #0\n\tcset\tw8, ne\n\ttbnz\tw8, #0, LBB0_11\n\tb\tLBB0_10\nLBB0_10:\n\tldur\tx8, [x29, #-64]\n\tadd\tx0, x8, #5\n\tmov\tx1, #0\n\tmov\tw2, #10\n\tbl\t_pg_strtouint64\n\n```", "role": "user" }, { "content": "```armasm\n\tstur\tx0, [x29, #-88]\n\tb\tLBB0_12\nLBB0_11:\n\tstur\txzr, [x29, #-88]\n\tb\tLBB0_12\nLBB0_12:\n\tldr\tx8, [sp, #24] ; 8-byte Folded Reload\n\tldr\tx9, [x8, #80]\n\tldr\tx10, [sp, #208]\n\tsubs\tx9, x9, x10\n\tadd\tx10, sp, #40\n\tstr\tx10, [sp, #8] ; 8-byte Folded Spill\n\tstr\tx9, [sp, #120]\n\tldr\tx9, [x8, #72]\n\tldr\tx10, [sp, #200]\n\tsubs\tx9, x9, x10\n\tstr\tx9, [sp, #112]\n\tldr\tx9, [x8, #64]\n\tldr\tx10, [sp, #192]\n```", "role": "assistant" } ]
extr_pg_stat_statements.c_pgss_ProcessUtility.c
[ { "content": "You are given an x86 assembly block (<block>) to traspile into armv8_64 assembly.\nYou are also given the context for this block in the form of pre-context (<pre_context>) and post-context (<post_context>).\nThere is also a pre-target-context (<pre_target>) which is the context for the target block. Use the input pre and post context along with the target pre context to transpile the block from x86 to armv8_64.\n\n```x86asm\n; <pre-context>\n\tmovq\t%rax, -160(%rbp)\n\tmovq\tpgBufferUsage+72(%rip), %rax\n\tsubq\t-80(%rbp), %rax\n\tmovq\t%rax, -168(%rbp)\n\tmovq\tpgBufferUsage+64(%rip), %rax\n\n; <block>\n\tsubq\t-88(%rbp), %rax\n\tmovq\t%rax, -176(%rbp)\n\tmovq\tpgBufferUsage+56(%rip), %rax\n\tsubq\t-96(%rbp), %rax\n\tmovq\t%rax, -184(%rbp)\n\tmovq\tpgBufferUsage+48(%rip), %rax\n\tsubq\t-104(%rbp), %rax\n\tmovq\t%rax, -192(%rbp)\n\tmovq\tpgBufferUsage+40(%rip), %rax\n\tsubq\t-112(%rbp), %rax\n\n; <post-context>\n\tmovq\t%rax, -200(%rbp)\n\tmovq\tpgBufferUsage+32(%rip), %rax\n\tsubq\t-120(%rbp), %rax\n\tmovq\t%rax, -208(%rbp)\n\tmovq\tpgBufferUsage+24(%rip), %rax\n\n```\n\n```armasm\n; <pre-target>\n\t.cfi_startproc\n; %bb.0:\n\tsub\tsp, sp, #320\n\t.cfi_def_cfa_offset 320\n\tstp\tx28, x27, [sp, #288] ; 16-byte Folded Spill\n\tstp\tx29, x30, [sp, #304] ; 16-byte Folded Spill\n\tadd\tx29, sp, #304\n\t.cfi_def_cfa w29, 16\n\t.cfi_offset w30, -8\n\t.cfi_offset w29, -16\n\t.cfi_offset w27, -24\n\t.cfi_offset w28, -32\n\tadrp\tx8, _pgBufferUsage@GOTPAGE\n\tldr\tx8, [x8, _pgBufferUsage@GOTPAGEOFF]\n\tstr\tx8, [sp, #24] ; 8-byte Folded Spill\n\tadrp\tx8, _nested_level@GOTPAGE\n\tldr\tx8, [x8, _nested_level@GOTPAGEOFF]\n\tstr\tx8, [sp, #32] ; 8-byte Folded Spill\n\tstur\tx0, [x29, #-24]\n\tstur\tx1, [x29, #-32]\n\tstur\tw2, [x29, #-36]\n\tstur\tw3, [x29, #-40]\n\tstur\tx4, [x29, #-48]\n\tstur\tx5, [x29, #-56]\n\tstur\tx6, [x29, #-64]\n\tldur\tx8, [x29, #-24]\n\tldr\tx8, [x8, #8]\n\tstur\tx8, [x29, #-72]\n\tadrp\tx8, _pgss_track_utility@GOTPAGE\n\tldr\tx8, [x8, _pgss_track_utility@GOTPAGEOFF]\n\tldr\tx8, [x8]\n\tsubs\tx8, x8, #0\n\tcset\tw8, eq\n\ttbnz\tw8, #0, LBB0_13\n\tb\tLBB0_1\nLBB0_1:\n\tbl\t_pgss_enabled\n\tsubs\tx8, x0, #0\n\tcset\tw8, eq\n\ttbnz\tw8, #0, LBB0_13\n\tb\tLBB0_2\nLBB0_2:\n\tldur\tx0, [x29, #-72]\n\tadrp\tx8, _ExecuteStmt@GOTPAGE\n\tldr\tx8, [x8, _ExecuteStmt@GOTPAGEOFF]\n\tldr\tw1, [x8]\n\tbl\t_IsA\n\tsubs\tw8, w0, #0\n\tcset\tw8, ne\n\ttbnz\tw8, #0, LBB0_13\n\tb\tLBB0_3\nLBB0_3:\n\tldur\tx0, [x29, #-72]\n\tadrp\tx8, _PrepareStmt@GOTPAGE\n\tldr\tx8, [x8, _PrepareStmt@GOTPAGEOFF]\n\tldr\tw1, [x8]\n\tbl\t_IsA\n\tsubs\tw8, w0, #0\n\tcset\tw8, ne\n\ttbnz\tw8, #0, LBB0_13\n\tb\tLBB0_4\nLBB0_4:\n\tldur\tx0, [x29, #-72]\n\tadrp\tx8, _DeallocateStmt@GOTPAGE\n\tldr\tx8, [x8, _DeallocateStmt@GOTPAGEOFF]\n\tldr\tw1, [x8]\n\tbl\t_IsA\n\tsubs\tw8, w0, #0\n\tcset\tw8, ne\n\ttbnz\tw8, #0, LBB0_13\n\tb\tLBB0_5\nLBB0_5:\n\tldr\tx1, [sp, #24] ; 8-byte Folded Reload\n\tadd\tx0, sp, #128\n\tmov\tx2, #88\n\tbl\t_memcpy\n\tldur\tw0, [x29, #-76]\n\tbl\t_INSTR_TIME_SET_CURRENT\n\tldr\tx9, [sp, #32] ; 8-byte Folded Reload\n\tldr\tw8, [x9]\n\tadd\tw8, w8, #1\n\tstr\tw8, [x9]\n\tbl\t_PG_TRY\n\tmov\tw8, #1\n\ttbz\tw8, #0, LBB0_7\n\tb\tLBB0_6\nLBB0_6:\n\tldur\tx0, [x29, #-24]\n\tldur\tx1, [x29, #-32]\n\tldur\tw2, [x29, #-36]\n\tldur\tw3, [x29, #-40]\n\tldur\tx4, [x29, #-48]\n\tldur\tx5, [x29, #-56]\n\tldur\tx6, [x29, #-64]\n\tbl\t_prev_ProcessUtility\n\tb\tLBB0_8\nLBB0_7:\n\tldur\tx0, [x29, #-24]\n\tldur\tx1, [x29, #-32]\n\tldur\tw2, [x29, #-36]\n\tldur\tw3, [x29, #-40]\n\tldur\tx4, [x29, #-48]\n\tldur\tx5, [x29, #-56]\n\tldur\tx6, [x29, #-64]\n\tbl\t_standard_ProcessUtility\n\tb\tLBB0_8\nLBB0_8:\n\tbl\t_PG_FINALLY\n\tldr\tx9, [sp, #32] ; 8-byte Folded Reload\n\tldr\tw8, [x9]\n\tsubs\tw8, w8, #1\n\tstr\tw8, [x9]\n\tbl\t_PG_END_TRY\n\tldur\tw0, [x29, #-80]\n\tbl\t_INSTR_TIME_SET_CURRENT\n\tldur\tw0, [x29, #-80]\n\tldur\tw1, [x29, #-76]\n\tbl\t_INSTR_TIME_SUBTRACT\n\tldur\tx8, [x29, #-64]\n\tsubs\tx8, x8, #0\n\tcset\tw8, eq\n\ttbnz\tw8, #0, LBB0_11\n\tb\tLBB0_9\nLBB0_9:\n\tldur\tx0, [x29, #-64]\n\tadrp\tx1, l_.str@PAGE\n\tadd\tx1, x1, l_.str@PAGEOFF\n\tmov\tw2, #5\n\tbl\t_strncmp\n\tsubs\tx8, x0, #0\n\tcset\tw8, ne\n\ttbnz\tw8, #0, LBB0_11\n\tb\tLBB0_10\nLBB0_10:\n\tldur\tx8, [x29, #-64]\n\tadd\tx0, x8, #5\n\tmov\tx1, #0\n\tmov\tw2, #10\n\tbl\t_pg_strtouint64\n\tstur\tx0, [x29, #-88]\n\tb\tLBB0_12\nLBB0_11:\n\tstur\txzr, [x29, #-88]\n\tb\tLBB0_12\nLBB0_12:\n\tldr\tx8, [sp, #24] ; 8-byte Folded Reload\n\tldr\tx9, [x8, #80]\n\tldr\tx10, [sp, #208]\n\tsubs\tx9, x9, x10\n\tadd\tx10, sp, #40\n\tstr\tx10, [sp, #8] ; 8-byte Folded Spill\n\tstr\tx9, [sp, #120]\n\tldr\tx9, [x8, #72]\n\tldr\tx10, [sp, #200]\n\tsubs\tx9, x9, x10\n\tstr\tx9, [sp, #112]\n\tldr\tx9, [x8, #64]\n\tldr\tx10, [sp, #192]\n\n```", "role": "user" }, { "content": "```armasm\n\tsubs\tx9, x9, x10\n\tstr\tx9, [sp, #104]\n\tldr\tx9, [x8, #56]\n\tldr\tx10, [sp, #184]\n\tsubs\tx9, x9, x10\n\tstr\tx9, [sp, #96]\n\tldr\tx9, [x8, #48]\n\tldr\tx10, [sp, #176]\n\tsubs\tx9, x9, x10\n\tstr\tx9, [sp, #88]\n\tldr\tx9, [x8, #40]\n\tldr\tx10, [sp, #168]\n\tsubs\tx9, x9, x10\n```", "role": "assistant" } ]
extr_pg_stat_statements.c_pgss_ProcessUtility.c
[ { "content": "You are given an x86 assembly block (<block>) to traspile into armv8_64 assembly.\nYou are also given the context for this block in the form of pre-context (<pre_context>) and post-context (<post_context>).\nThere is also a pre-target-context (<pre_target>) which is the context for the target block. Use the input pre and post context along with the target pre context to transpile the block from x86 to armv8_64.\n\n```x86asm\n; <pre-context>\n\tmovq\tpgBufferUsage+48(%rip), %rax\n\tsubq\t-104(%rbp), %rax\n\tmovq\t%rax, -192(%rbp)\n\tmovq\tpgBufferUsage+40(%rip), %rax\n\tsubq\t-112(%rbp), %rax\n\n; <block>\n\tmovq\t%rax, -200(%rbp)\n\tmovq\tpgBufferUsage+32(%rip), %rax\n\tsubq\t-120(%rbp), %rax\n\tmovq\t%rax, -208(%rbp)\n\tmovq\tpgBufferUsage+24(%rip), %rax\n\tsubq\t-128(%rbp), %rax\n\tmovq\t%rax, -216(%rbp)\n\tmovq\tpgBufferUsage+16(%rip), %rax\n\tsubq\t-136(%rbp), %rax\n\tmovq\t%rax, -224(%rbp)\n\n; <post-context>\n\tmovq\tpgBufferUsage+8(%rip), %rax\n\tsubq\t-144(%rbp), %rax\n\tmovq\t%rax, -232(%rbp)\n\tmovl\tpgBufferUsage+4(%rip), %eax\n\tmovl\t%eax, -236(%rbp)\n\n```\n\n```armasm\n; <pre-target>\n\t.cfi_startproc\n; %bb.0:\n\tsub\tsp, sp, #320\n\t.cfi_def_cfa_offset 320\n\tstp\tx28, x27, [sp, #288] ; 16-byte Folded Spill\n\tstp\tx29, x30, [sp, #304] ; 16-byte Folded Spill\n\tadd\tx29, sp, #304\n\t.cfi_def_cfa w29, 16\n\t.cfi_offset w30, -8\n\t.cfi_offset w29, -16\n\t.cfi_offset w27, -24\n\t.cfi_offset w28, -32\n\tadrp\tx8, _pgBufferUsage@GOTPAGE\n\tldr\tx8, [x8, _pgBufferUsage@GOTPAGEOFF]\n\tstr\tx8, [sp, #24] ; 8-byte Folded Spill\n\tadrp\tx8, _nested_level@GOTPAGE\n\tldr\tx8, [x8, _nested_level@GOTPAGEOFF]\n\tstr\tx8, [sp, #32] ; 8-byte Folded Spill\n\tstur\tx0, [x29, #-24]\n\tstur\tx1, [x29, #-32]\n\tstur\tw2, [x29, #-36]\n\tstur\tw3, [x29, #-40]\n\tstur\tx4, [x29, #-48]\n\tstur\tx5, [x29, #-56]\n\tstur\tx6, [x29, #-64]\n\tldur\tx8, [x29, #-24]\n\tldr\tx8, [x8, #8]\n\tstur\tx8, [x29, #-72]\n\tadrp\tx8, _pgss_track_utility@GOTPAGE\n\tldr\tx8, [x8, _pgss_track_utility@GOTPAGEOFF]\n\tldr\tx8, [x8]\n\tsubs\tx8, x8, #0\n\tcset\tw8, eq\n\ttbnz\tw8, #0, LBB0_13\n\tb\tLBB0_1\nLBB0_1:\n\tbl\t_pgss_enabled\n\tsubs\tx8, x0, #0\n\tcset\tw8, eq\n\ttbnz\tw8, #0, LBB0_13\n\tb\tLBB0_2\nLBB0_2:\n\tldur\tx0, [x29, #-72]\n\tadrp\tx8, _ExecuteStmt@GOTPAGE\n\tldr\tx8, [x8, _ExecuteStmt@GOTPAGEOFF]\n\tldr\tw1, [x8]\n\tbl\t_IsA\n\tsubs\tw8, w0, #0\n\tcset\tw8, ne\n\ttbnz\tw8, #0, LBB0_13\n\tb\tLBB0_3\nLBB0_3:\n\tldur\tx0, [x29, #-72]\n\tadrp\tx8, _PrepareStmt@GOTPAGE\n\tldr\tx8, [x8, _PrepareStmt@GOTPAGEOFF]\n\tldr\tw1, [x8]\n\tbl\t_IsA\n\tsubs\tw8, w0, #0\n\tcset\tw8, ne\n\ttbnz\tw8, #0, LBB0_13\n\tb\tLBB0_4\nLBB0_4:\n\tldur\tx0, [x29, #-72]\n\tadrp\tx8, _DeallocateStmt@GOTPAGE\n\tldr\tx8, [x8, _DeallocateStmt@GOTPAGEOFF]\n\tldr\tw1, [x8]\n\tbl\t_IsA\n\tsubs\tw8, w0, #0\n\tcset\tw8, ne\n\ttbnz\tw8, #0, LBB0_13\n\tb\tLBB0_5\nLBB0_5:\n\tldr\tx1, [sp, #24] ; 8-byte Folded Reload\n\tadd\tx0, sp, #128\n\tmov\tx2, #88\n\tbl\t_memcpy\n\tldur\tw0, [x29, #-76]\n\tbl\t_INSTR_TIME_SET_CURRENT\n\tldr\tx9, [sp, #32] ; 8-byte Folded Reload\n\tldr\tw8, [x9]\n\tadd\tw8, w8, #1\n\tstr\tw8, [x9]\n\tbl\t_PG_TRY\n\tmov\tw8, #1\n\ttbz\tw8, #0, LBB0_7\n\tb\tLBB0_6\nLBB0_6:\n\tldur\tx0, [x29, #-24]\n\tldur\tx1, [x29, #-32]\n\tldur\tw2, [x29, #-36]\n\tldur\tw3, [x29, #-40]\n\tldur\tx4, [x29, #-48]\n\tldur\tx5, [x29, #-56]\n\tldur\tx6, [x29, #-64]\n\tbl\t_prev_ProcessUtility\n\tb\tLBB0_8\nLBB0_7:\n\tldur\tx0, [x29, #-24]\n\tldur\tx1, [x29, #-32]\n\tldur\tw2, [x29, #-36]\n\tldur\tw3, [x29, #-40]\n\tldur\tx4, [x29, #-48]\n\tldur\tx5, [x29, #-56]\n\tldur\tx6, [x29, #-64]\n\tbl\t_standard_ProcessUtility\n\tb\tLBB0_8\nLBB0_8:\n\tbl\t_PG_FINALLY\n\tldr\tx9, [sp, #32] ; 8-byte Folded Reload\n\tldr\tw8, [x9]\n\tsubs\tw8, w8, #1\n\tstr\tw8, [x9]\n\tbl\t_PG_END_TRY\n\tldur\tw0, [x29, #-80]\n\tbl\t_INSTR_TIME_SET_CURRENT\n\tldur\tw0, [x29, #-80]\n\tldur\tw1, [x29, #-76]\n\tbl\t_INSTR_TIME_SUBTRACT\n\tldur\tx8, [x29, #-64]\n\tsubs\tx8, x8, #0\n\tcset\tw8, eq\n\ttbnz\tw8, #0, LBB0_11\n\tb\tLBB0_9\nLBB0_9:\n\tldur\tx0, [x29, #-64]\n\tadrp\tx1, l_.str@PAGE\n\tadd\tx1, x1, l_.str@PAGEOFF\n\tmov\tw2, #5\n\tbl\t_strncmp\n\tsubs\tx8, x0, #0\n\tcset\tw8, ne\n\ttbnz\tw8, #0, LBB0_11\n\tb\tLBB0_10\nLBB0_10:\n\tldur\tx8, [x29, #-64]\n\tadd\tx0, x8, #5\n\tmov\tx1, #0\n\tmov\tw2, #10\n\tbl\t_pg_strtouint64\n\tstur\tx0, [x29, #-88]\n\tb\tLBB0_12\nLBB0_11:\n\tstur\txzr, [x29, #-88]\n\tb\tLBB0_12\nLBB0_12:\n\tldr\tx8, [sp, #24] ; 8-byte Folded Reload\n\tldr\tx9, [x8, #80]\n\tldr\tx10, [sp, #208]\n\tsubs\tx9, x9, x10\n\tadd\tx10, sp, #40\n\tstr\tx10, [sp, #8] ; 8-byte Folded Spill\n\tstr\tx9, [sp, #120]\n\tldr\tx9, [x8, #72]\n\tldr\tx10, [sp, #200]\n\tsubs\tx9, x9, x10\n\tstr\tx9, [sp, #112]\n\tldr\tx9, [x8, #64]\n\tldr\tx10, [sp, #192]\n\tsubs\tx9, x9, x10\n\tstr\tx9, [sp, #104]\n\tldr\tx9, [x8, #56]\n\tldr\tx10, [sp, #184]\n\tsubs\tx9, x9, x10\n\tstr\tx9, [sp, #96]\n\tldr\tx9, [x8, #48]\n\tldr\tx10, [sp, #176]\n\tsubs\tx9, x9, x10\n\tstr\tx9, [sp, #88]\n\tldr\tx9, [x8, #40]\n\tldr\tx10, [sp, #168]\n\tsubs\tx9, x9, x10\n\n```", "role": "user" }, { "content": "```armasm\n\tstr\tx9, [sp, #80]\n\tldr\tx9, [x8, #32]\n\tldr\tx10, [sp, #160]\n\tsubs\tx9, x9, x10\n\tstr\tx9, [sp, #72]\n\tldr\tx9, [x8, #24]\n\tldr\tx10, [sp, #152]\n\tsubs\tx9, x9, x10\n\tstr\tx9, [sp, #64]\n\tldr\tx9, [x8, #16]\n\tldr\tx10, [sp, #144]\n\tsubs\tx9, x9, x10\n\tstr\tx9, [sp, #56]\n```", "role": "assistant" } ]
extr_pg_stat_statements.c_pgss_ProcessUtility.c
[ { "content": "You are given an x86 assembly block (<block>) to traspile into armv8_64 assembly.\nYou are also given the context for this block in the form of pre-context (<pre_context>) and post-context (<post_context>).\nThere is also a pre-target-context (<pre_target>) which is the context for the target block. Use the input pre and post context along with the target pre context to transpile the block from x86 to armv8_64.\n\n```x86asm\n; <pre-context>\n\tsubq\t-128(%rbp), %rax\n\tmovq\t%rax, -216(%rbp)\n\tmovq\tpgBufferUsage+16(%rip), %rax\n\tsubq\t-136(%rbp), %rax\n\tmovq\t%rax, -224(%rbp)\n\n; <block>\n\tmovq\tpgBufferUsage+8(%rip), %rax\n\tsubq\t-144(%rbp), %rax\n\tmovq\t%rax, -232(%rbp)\n\tmovl\tpgBufferUsage+4(%rip), %eax\n\tmovl\t%eax, -236(%rbp)\n\tmovl\t-236(%rbp), %edi\n\tmovl\t-148(%rbp), %esi\n\tcallq\tINSTR_TIME_SUBTRACT@PLT\n\tmovl\tpgBufferUsage(%rip), %eax\n\tmovl\t%eax, -240(%rbp)\n\n; <post-context>\n\tmovl\t-240(%rbp), %edi\n\tmovl\t-152(%rbp), %esi\n\tcallq\tINSTR_TIME_SUBTRACT@PLT\n\tmovq\t-16(%rbp), %rax\n\tmovq\t%rax, -256(%rbp) # 8-byte Spill\n\tmovq\t-8(%rbp), %rax\n\n```\n\n```armasm\n; <pre-target>\n\t.cfi_startproc\n; %bb.0:\n\tsub\tsp, sp, #320\n\t.cfi_def_cfa_offset 320\n\tstp\tx28, x27, [sp, #288] ; 16-byte Folded Spill\n\tstp\tx29, x30, [sp, #304] ; 16-byte Folded Spill\n\tadd\tx29, sp, #304\n\t.cfi_def_cfa w29, 16\n\t.cfi_offset w30, -8\n\t.cfi_offset w29, -16\n\t.cfi_offset w27, -24\n\t.cfi_offset w28, -32\n\tadrp\tx8, _pgBufferUsage@GOTPAGE\n\tldr\tx8, [x8, _pgBufferUsage@GOTPAGEOFF]\n\tstr\tx8, [sp, #24] ; 8-byte Folded Spill\n\tadrp\tx8, _nested_level@GOTPAGE\n\tldr\tx8, [x8, _nested_level@GOTPAGEOFF]\n\tstr\tx8, [sp, #32] ; 8-byte Folded Spill\n\tstur\tx0, [x29, #-24]\n\tstur\tx1, [x29, #-32]\n\tstur\tw2, [x29, #-36]\n\tstur\tw3, [x29, #-40]\n\tstur\tx4, [x29, #-48]\n\tstur\tx5, [x29, #-56]\n\tstur\tx6, [x29, #-64]\n\tldur\tx8, [x29, #-24]\n\tldr\tx8, [x8, #8]\n\tstur\tx8, [x29, #-72]\n\tadrp\tx8, _pgss_track_utility@GOTPAGE\n\tldr\tx8, [x8, _pgss_track_utility@GOTPAGEOFF]\n\tldr\tx8, [x8]\n\tsubs\tx8, x8, #0\n\tcset\tw8, eq\n\ttbnz\tw8, #0, LBB0_13\n\tb\tLBB0_1\nLBB0_1:\n\tbl\t_pgss_enabled\n\tsubs\tx8, x0, #0\n\tcset\tw8, eq\n\ttbnz\tw8, #0, LBB0_13\n\tb\tLBB0_2\nLBB0_2:\n\tldur\tx0, [x29, #-72]\n\tadrp\tx8, _ExecuteStmt@GOTPAGE\n\tldr\tx8, [x8, _ExecuteStmt@GOTPAGEOFF]\n\tldr\tw1, [x8]\n\tbl\t_IsA\n\tsubs\tw8, w0, #0\n\tcset\tw8, ne\n\ttbnz\tw8, #0, LBB0_13\n\tb\tLBB0_3\nLBB0_3:\n\tldur\tx0, [x29, #-72]\n\tadrp\tx8, _PrepareStmt@GOTPAGE\n\tldr\tx8, [x8, _PrepareStmt@GOTPAGEOFF]\n\tldr\tw1, [x8]\n\tbl\t_IsA\n\tsubs\tw8, w0, #0\n\tcset\tw8, ne\n\ttbnz\tw8, #0, LBB0_13\n\tb\tLBB0_4\nLBB0_4:\n\tldur\tx0, [x29, #-72]\n\tadrp\tx8, _DeallocateStmt@GOTPAGE\n\tldr\tx8, [x8, _DeallocateStmt@GOTPAGEOFF]\n\tldr\tw1, [x8]\n\tbl\t_IsA\n\tsubs\tw8, w0, #0\n\tcset\tw8, ne\n\ttbnz\tw8, #0, LBB0_13\n\tb\tLBB0_5\nLBB0_5:\n\tldr\tx1, [sp, #24] ; 8-byte Folded Reload\n\tadd\tx0, sp, #128\n\tmov\tx2, #88\n\tbl\t_memcpy\n\tldur\tw0, [x29, #-76]\n\tbl\t_INSTR_TIME_SET_CURRENT\n\tldr\tx9, [sp, #32] ; 8-byte Folded Reload\n\tldr\tw8, [x9]\n\tadd\tw8, w8, #1\n\tstr\tw8, [x9]\n\tbl\t_PG_TRY\n\tmov\tw8, #1\n\ttbz\tw8, #0, LBB0_7\n\tb\tLBB0_6\nLBB0_6:\n\tldur\tx0, [x29, #-24]\n\tldur\tx1, [x29, #-32]\n\tldur\tw2, [x29, #-36]\n\tldur\tw3, [x29, #-40]\n\tldur\tx4, [x29, #-48]\n\tldur\tx5, [x29, #-56]\n\tldur\tx6, [x29, #-64]\n\tbl\t_prev_ProcessUtility\n\tb\tLBB0_8\nLBB0_7:\n\tldur\tx0, [x29, #-24]\n\tldur\tx1, [x29, #-32]\n\tldur\tw2, [x29, #-36]\n\tldur\tw3, [x29, #-40]\n\tldur\tx4, [x29, #-48]\n\tldur\tx5, [x29, #-56]\n\tldur\tx6, [x29, #-64]\n\tbl\t_standard_ProcessUtility\n\tb\tLBB0_8\nLBB0_8:\n\tbl\t_PG_FINALLY\n\tldr\tx9, [sp, #32] ; 8-byte Folded Reload\n\tldr\tw8, [x9]\n\tsubs\tw8, w8, #1\n\tstr\tw8, [x9]\n\tbl\t_PG_END_TRY\n\tldur\tw0, [x29, #-80]\n\tbl\t_INSTR_TIME_SET_CURRENT\n\tldur\tw0, [x29, #-80]\n\tldur\tw1, [x29, #-76]\n\tbl\t_INSTR_TIME_SUBTRACT\n\tldur\tx8, [x29, #-64]\n\tsubs\tx8, x8, #0\n\tcset\tw8, eq\n\ttbnz\tw8, #0, LBB0_11\n\tb\tLBB0_9\nLBB0_9:\n\tldur\tx0, [x29, #-64]\n\tadrp\tx1, l_.str@PAGE\n\tadd\tx1, x1, l_.str@PAGEOFF\n\tmov\tw2, #5\n\tbl\t_strncmp\n\tsubs\tx8, x0, #0\n\tcset\tw8, ne\n\ttbnz\tw8, #0, LBB0_11\n\tb\tLBB0_10\nLBB0_10:\n\tldur\tx8, [x29, #-64]\n\tadd\tx0, x8, #5\n\tmov\tx1, #0\n\tmov\tw2, #10\n\tbl\t_pg_strtouint64\n\tstur\tx0, [x29, #-88]\n\tb\tLBB0_12\nLBB0_11:\n\tstur\txzr, [x29, #-88]\n\tb\tLBB0_12\nLBB0_12:\n\tldr\tx8, [sp, #24] ; 8-byte Folded Reload\n\tldr\tx9, [x8, #80]\n\tldr\tx10, [sp, #208]\n\tsubs\tx9, x9, x10\n\tadd\tx10, sp, #40\n\tstr\tx10, [sp, #8] ; 8-byte Folded Spill\n\tstr\tx9, [sp, #120]\n\tldr\tx9, [x8, #72]\n\tldr\tx10, [sp, #200]\n\tsubs\tx9, x9, x10\n\tstr\tx9, [sp, #112]\n\tldr\tx9, [x8, #64]\n\tldr\tx10, [sp, #192]\n\tsubs\tx9, x9, x10\n\tstr\tx9, [sp, #104]\n\tldr\tx9, [x8, #56]\n\tldr\tx10, [sp, #184]\n\tsubs\tx9, x9, x10\n\tstr\tx9, [sp, #96]\n\tldr\tx9, [x8, #48]\n\tldr\tx10, [sp, #176]\n\tsubs\tx9, x9, x10\n\tstr\tx9, [sp, #88]\n\tldr\tx9, [x8, #40]\n\tldr\tx10, [sp, #168]\n\tsubs\tx9, x9, x10\n\tstr\tx9, [sp, #80]\n\tldr\tx9, [x8, #32]\n\tldr\tx10, [sp, #160]\n\tsubs\tx9, x9, x10\n\tstr\tx9, [sp, #72]\n\tldr\tx9, [x8, #24]\n\tldr\tx10, [sp, #152]\n\tsubs\tx9, x9, x10\n\tstr\tx9, [sp, #64]\n\tldr\tx9, [x8, #16]\n\tldr\tx10, [sp, #144]\n\tsubs\tx9, x9, x10\n\tstr\tx9, [sp, #56]\n\n```", "role": "user" }, { "content": "```armasm\n\tldr\tx9, [x8, #8]\n\tldr\tx10, [sp, #136]\n\tsubs\tx9, x9, x10\n\tstr\tx9, [sp, #48]\n\tldr\tw8, [x8, #4]\n\tstr\tw8, [sp, #44]\n\tldr\tw0, [sp, #44]\n\tldr\tw1, [sp, #132]\n\tbl\t_INSTR_TIME_SUBTRACT\n\tldr\tx8, [sp, #24] ; 8-byte Folded Reload\n\tldr\tw8, [x8]\n\tstr\tw8, [sp, #40]\n```", "role": "assistant" } ]
extr_pg_stat_statements.c_pgss_ProcessUtility.c
[ { "content": "You are given an x86 assembly block (<block>) to traspile into armv8_64 assembly.\nYou are also given the context for this block in the form of pre-context (<pre_context>) and post-context (<post_context>).\nThere is also a pre-target-context (<pre_target>) which is the context for the target block. Use the input pre and post context along with the target pre context to transpile the block from x86 to armv8_64.\n\n```x86asm\n; <pre-context>\n\tmovl\t-236(%rbp), %edi\n\tmovl\t-148(%rbp), %esi\n\tcallq\tINSTR_TIME_SUBTRACT@PLT\n\tmovl\tpgBufferUsage(%rip), %eax\n\tmovl\t%eax, -240(%rbp)\n\n; <block>\n\tmovl\t-240(%rbp), %edi\n\tmovl\t-152(%rbp), %esi\n\tcallq\tINSTR_TIME_SUBTRACT@PLT\n\tmovq\t-16(%rbp), %rax\n\tmovq\t%rax, -256(%rbp) # 8-byte Spill\n\tmovq\t-8(%rbp), %rax\n\tmovl\t4(%rax), %eax\n\tmovl\t%eax, -248(%rbp) # 4-byte Spill\n\tmovq\t-8(%rbp), %rax\n\tmovl\t(%rax), %eax\n\tmovl\t%eax, -244(%rbp) # 4-byte Spill\n\tmovl\t-56(%rbp), %edi\n\tcallq\tINSTR_TIME_GET_MILLISEC@PLT\n\tmovq\t-256(%rbp), %rdi # 8-byte Reload\n\tmovl\t-248(%rbp), %edx # 4-byte Reload\n\tmovl\t-244(%rbp), %ecx # 4-byte Reload\n\tmovl\t%eax, %r8d\n\n; <post-context>\n\tmovq\t-64(%rbp), %r9\n\txorl\t%esi, %esi\n\tleaq\t-240(%rbp), %rax\n\txorl\t%r10d, %r10d\n # kill: def $r10 killed $r10d\n\tmovq\t%rax, (%rsp)\n\tmovq\t$0, 8(%rsp)\n\tcallq\tpgss_store@PLT\n\tjmp\t.LBB0_17\n.LBB0_13:\n\tmovb\t$1, %al\n\ttestb\t$1, %al\n\tjne\t.LBB0_14\n\tjmp\t.LBB0_15\n.LBB0_14:\n\tmovq\t-8(%rbp), %rdi\n\n```\n\n```armasm\n; <pre-target>\n\t.cfi_startproc\n; %bb.0:\n\tsub\tsp, sp, #320\n\t.cfi_def_cfa_offset 320\n\tstp\tx28, x27, [sp, #288] ; 16-byte Folded Spill\n\tstp\tx29, x30, [sp, #304] ; 16-byte Folded Spill\n\tadd\tx29, sp, #304\n\t.cfi_def_cfa w29, 16\n\t.cfi_offset w30, -8\n\t.cfi_offset w29, -16\n\t.cfi_offset w27, -24\n\t.cfi_offset w28, -32\n\tadrp\tx8, _pgBufferUsage@GOTPAGE\n\tldr\tx8, [x8, _pgBufferUsage@GOTPAGEOFF]\n\tstr\tx8, [sp, #24] ; 8-byte Folded Spill\n\tadrp\tx8, _nested_level@GOTPAGE\n\tldr\tx8, [x8, _nested_level@GOTPAGEOFF]\n\tstr\tx8, [sp, #32] ; 8-byte Folded Spill\n\tstur\tx0, [x29, #-24]\n\tstur\tx1, [x29, #-32]\n\tstur\tw2, [x29, #-36]\n\tstur\tw3, [x29, #-40]\n\tstur\tx4, [x29, #-48]\n\tstur\tx5, [x29, #-56]\n\tstur\tx6, [x29, #-64]\n\tldur\tx8, [x29, #-24]\n\tldr\tx8, [x8, #8]\n\tstur\tx8, [x29, #-72]\n\tadrp\tx8, _pgss_track_utility@GOTPAGE\n\tldr\tx8, [x8, _pgss_track_utility@GOTPAGEOFF]\n\tldr\tx8, [x8]\n\tsubs\tx8, x8, #0\n\tcset\tw8, eq\n\ttbnz\tw8, #0, LBB0_13\n\tb\tLBB0_1\nLBB0_1:\n\tbl\t_pgss_enabled\n\tsubs\tx8, x0, #0\n\tcset\tw8, eq\n\ttbnz\tw8, #0, LBB0_13\n\tb\tLBB0_2\nLBB0_2:\n\tldur\tx0, [x29, #-72]\n\tadrp\tx8, _ExecuteStmt@GOTPAGE\n\tldr\tx8, [x8, _ExecuteStmt@GOTPAGEOFF]\n\tldr\tw1, [x8]\n\tbl\t_IsA\n\tsubs\tw8, w0, #0\n\tcset\tw8, ne\n\ttbnz\tw8, #0, LBB0_13\n\tb\tLBB0_3\nLBB0_3:\n\tldur\tx0, [x29, #-72]\n\tadrp\tx8, _PrepareStmt@GOTPAGE\n\tldr\tx8, [x8, _PrepareStmt@GOTPAGEOFF]\n\tldr\tw1, [x8]\n\tbl\t_IsA\n\tsubs\tw8, w0, #0\n\tcset\tw8, ne\n\ttbnz\tw8, #0, LBB0_13\n\tb\tLBB0_4\nLBB0_4:\n\tldur\tx0, [x29, #-72]\n\tadrp\tx8, _DeallocateStmt@GOTPAGE\n\tldr\tx8, [x8, _DeallocateStmt@GOTPAGEOFF]\n\tldr\tw1, [x8]\n\tbl\t_IsA\n\tsubs\tw8, w0, #0\n\tcset\tw8, ne\n\ttbnz\tw8, #0, LBB0_13\n\tb\tLBB0_5\nLBB0_5:\n\tldr\tx1, [sp, #24] ; 8-byte Folded Reload\n\tadd\tx0, sp, #128\n\tmov\tx2, #88\n\tbl\t_memcpy\n\tldur\tw0, [x29, #-76]\n\tbl\t_INSTR_TIME_SET_CURRENT\n\tldr\tx9, [sp, #32] ; 8-byte Folded Reload\n\tldr\tw8, [x9]\n\tadd\tw8, w8, #1\n\tstr\tw8, [x9]\n\tbl\t_PG_TRY\n\tmov\tw8, #1\n\ttbz\tw8, #0, LBB0_7\n\tb\tLBB0_6\nLBB0_6:\n\tldur\tx0, [x29, #-24]\n\tldur\tx1, [x29, #-32]\n\tldur\tw2, [x29, #-36]\n\tldur\tw3, [x29, #-40]\n\tldur\tx4, [x29, #-48]\n\tldur\tx5, [x29, #-56]\n\tldur\tx6, [x29, #-64]\n\tbl\t_prev_ProcessUtility\n\tb\tLBB0_8\nLBB0_7:\n\tldur\tx0, [x29, #-24]\n\tldur\tx1, [x29, #-32]\n\tldur\tw2, [x29, #-36]\n\tldur\tw3, [x29, #-40]\n\tldur\tx4, [x29, #-48]\n\tldur\tx5, [x29, #-56]\n\tldur\tx6, [x29, #-64]\n\tbl\t_standard_ProcessUtility\n\tb\tLBB0_8\nLBB0_8:\n\tbl\t_PG_FINALLY\n\tldr\tx9, [sp, #32] ; 8-byte Folded Reload\n\tldr\tw8, [x9]\n\tsubs\tw8, w8, #1\n\tstr\tw8, [x9]\n\tbl\t_PG_END_TRY\n\tldur\tw0, [x29, #-80]\n\tbl\t_INSTR_TIME_SET_CURRENT\n\tldur\tw0, [x29, #-80]\n\tldur\tw1, [x29, #-76]\n\tbl\t_INSTR_TIME_SUBTRACT\n\tldur\tx8, [x29, #-64]\n\tsubs\tx8, x8, #0\n\tcset\tw8, eq\n\ttbnz\tw8, #0, LBB0_11\n\tb\tLBB0_9\nLBB0_9:\n\tldur\tx0, [x29, #-64]\n\tadrp\tx1, l_.str@PAGE\n\tadd\tx1, x1, l_.str@PAGEOFF\n\tmov\tw2, #5\n\tbl\t_strncmp\n\tsubs\tx8, x0, #0\n\tcset\tw8, ne\n\ttbnz\tw8, #0, LBB0_11\n\tb\tLBB0_10\nLBB0_10:\n\tldur\tx8, [x29, #-64]\n\tadd\tx0, x8, #5\n\tmov\tx1, #0\n\tmov\tw2, #10\n\tbl\t_pg_strtouint64\n\tstur\tx0, [x29, #-88]\n\tb\tLBB0_12\nLBB0_11:\n\tstur\txzr, [x29, #-88]\n\tb\tLBB0_12\nLBB0_12:\n\tldr\tx8, [sp, #24] ; 8-byte Folded Reload\n\tldr\tx9, [x8, #80]\n\tldr\tx10, [sp, #208]\n\tsubs\tx9, x9, x10\n\tadd\tx10, sp, #40\n\tstr\tx10, [sp, #8] ; 8-byte Folded Spill\n\tstr\tx9, [sp, #120]\n\tldr\tx9, [x8, #72]\n\tldr\tx10, [sp, #200]\n\tsubs\tx9, x9, x10\n\tstr\tx9, [sp, #112]\n\tldr\tx9, [x8, #64]\n\tldr\tx10, [sp, #192]\n\tsubs\tx9, x9, x10\n\tstr\tx9, [sp, #104]\n\tldr\tx9, [x8, #56]\n\tldr\tx10, [sp, #184]\n\tsubs\tx9, x9, x10\n\tstr\tx9, [sp, #96]\n\tldr\tx9, [x8, #48]\n\tldr\tx10, [sp, #176]\n\tsubs\tx9, x9, x10\n\tstr\tx9, [sp, #88]\n\tldr\tx9, [x8, #40]\n\tldr\tx10, [sp, #168]\n\tsubs\tx9, x9, x10\n\tstr\tx9, [sp, #80]\n\tldr\tx9, [x8, #32]\n\tldr\tx10, [sp, #160]\n\tsubs\tx9, x9, x10\n\tstr\tx9, [sp, #72]\n\tldr\tx9, [x8, #24]\n\tldr\tx10, [sp, #152]\n\tsubs\tx9, x9, x10\n\tstr\tx9, [sp, #64]\n\tldr\tx9, [x8, #16]\n\tldr\tx10, [sp, #144]\n\tsubs\tx9, x9, x10\n\tstr\tx9, [sp, #56]\n\tldr\tx9, [x8, #8]\n\tldr\tx10, [sp, #136]\n\tsubs\tx9, x9, x10\n\tstr\tx9, [sp, #48]\n\tldr\tw8, [x8, #4]\n\tstr\tw8, [sp, #44]\n\tldr\tw0, [sp, #44]\n\tldr\tw1, [sp, #132]\n\tbl\t_INSTR_TIME_SUBTRACT\n\tldr\tx8, [sp, #24] ; 8-byte Folded Reload\n\tldr\tw8, [x8]\n\tstr\tw8, [sp, #40]\n\n```", "role": "user" }, { "content": "```armasm\n\tldr\tw0, [sp, #40]\n\tldr\tw1, [sp, #128]\n\tbl\t_INSTR_TIME_SUBTRACT\n\tldur\tx8, [x29, #-32]\n\tstr\tx8, [sp, #16] ; 8-byte Folded Spill\n\tldur\tx8, [x29, #-24]\n\tldr\tw8, [x8, #4]\n\tstr\tw8, [sp] ; 4-byte Folded Spill\n\tldur\tx8, [x29, #-24]\n\tldr\tw8, [x8]\n\tstr\tw8, [sp, #4] ; 4-byte Folded Spill\n\tldur\tw0, [x29, #-80]\n\tbl\t_INSTR_TIME_GET_MILLISEC\n\tldr\tw2, [sp] ; 4-byte Folded Reload\n\tldr\tw3, [sp, #4] ; 4-byte Folded Reload\n\tldr\tx6, [sp, #8] ; 8-byte Folded Reload\n\tmov\tx4, x0\n\tldr\tx0, [sp, #16] ; 8-byte Folded Reload\n```", "role": "assistant" } ]
extr_pg_stat_statements.c_pgss_ProcessUtility.c
[ { "content": "You are given an x86 assembly block (<block>) to traspile into armv8_64 assembly.\nYou are also given the context for this block in the form of pre-context (<pre_context>) and post-context (<post_context>).\nThere is also a pre-target-context (<pre_target>) which is the context for the target block. Use the input pre and post context along with the target pre context to transpile the block from x86 to armv8_64.\n\n```x86asm\n; <pre-context>\n\tmovl\t4(%rax), %eax\n\tmovl\t%eax, -248(%rbp) # 4-byte Spill\n\tmovq\t-8(%rbp), %rax\n\tmovl\t(%rax), %eax\n\tmovl\t%eax, -244(%rbp) # 4-byte Spill\n\tmovl\t-56(%rbp), %edi\n\tcallq\tINSTR_TIME_GET_MILLISEC@PLT\n\tmovq\t-256(%rbp), %rdi # 8-byte Reload\n\tmovl\t-248(%rbp), %edx # 4-byte Reload\n\tmovl\t-244(%rbp), %ecx # 4-byte Reload\n\tmovl\t%eax, %r8d\n\n; <block>\n\tmovq\t-64(%rbp), %r9\n\txorl\t%esi, %esi\n\tleaq\t-240(%rbp), %rax\n\txorl\t%r10d, %r10d\n # kill: def $r10 killed $r10d\n\tmovq\t%rax, (%rsp)\n\tmovq\t$0, 8(%rsp)\n\tcallq\tpgss_store@PLT\n\tjmp\t.LBB0_17\n.LBB0_13:\n\tmovb\t$1, %al\n\ttestb\t$1, %al\n\tjne\t.LBB0_14\n\tjmp\t.LBB0_15\n.LBB0_14:\n\tmovq\t-8(%rbp), %rdi\n\tmovq\t-16(%rbp), %rsi\n\tmovl\t-20(%rbp), %edx\n\tmovl\t-24(%rbp), %ecx\n\tmovq\t-32(%rbp), %r8\n\tmovq\t-40(%rbp), %r9\n\n; <post-context>\n\tmovq\t16(%rbp), %rax\n\tmovq\t%rax, (%rsp)\n\tcallq\tprev_ProcessUtility@PLT\n\tjmp\t.LBB0_16\n.LBB0_15:\n\tmovq\t-8(%rbp), %rdi\n\tmovq\t-16(%rbp), %rsi\n\tmovl\t-20(%rbp), %edx\n\n```\n\n```armasm\n; <pre-target>\n\t.cfi_startproc\n; %bb.0:\n\tsub\tsp, sp, #320\n\t.cfi_def_cfa_offset 320\n\tstp\tx28, x27, [sp, #288] ; 16-byte Folded Spill\n\tstp\tx29, x30, [sp, #304] ; 16-byte Folded Spill\n\tadd\tx29, sp, #304\n\t.cfi_def_cfa w29, 16\n\t.cfi_offset w30, -8\n\t.cfi_offset w29, -16\n\t.cfi_offset w27, -24\n\t.cfi_offset w28, -32\n\tadrp\tx8, _pgBufferUsage@GOTPAGE\n\tldr\tx8, [x8, _pgBufferUsage@GOTPAGEOFF]\n\tstr\tx8, [sp, #24] ; 8-byte Folded Spill\n\tadrp\tx8, _nested_level@GOTPAGE\n\tldr\tx8, [x8, _nested_level@GOTPAGEOFF]\n\tstr\tx8, [sp, #32] ; 8-byte Folded Spill\n\tstur\tx0, [x29, #-24]\n\tstur\tx1, [x29, #-32]\n\tstur\tw2, [x29, #-36]\n\tstur\tw3, [x29, #-40]\n\tstur\tx4, [x29, #-48]\n\tstur\tx5, [x29, #-56]\n\tstur\tx6, [x29, #-64]\n\tldur\tx8, [x29, #-24]\n\tldr\tx8, [x8, #8]\n\tstur\tx8, [x29, #-72]\n\tadrp\tx8, _pgss_track_utility@GOTPAGE\n\tldr\tx8, [x8, _pgss_track_utility@GOTPAGEOFF]\n\tldr\tx8, [x8]\n\tsubs\tx8, x8, #0\n\tcset\tw8, eq\n\ttbnz\tw8, #0, LBB0_13\n\tb\tLBB0_1\nLBB0_1:\n\tbl\t_pgss_enabled\n\tsubs\tx8, x0, #0\n\tcset\tw8, eq\n\ttbnz\tw8, #0, LBB0_13\n\tb\tLBB0_2\nLBB0_2:\n\tldur\tx0, [x29, #-72]\n\tadrp\tx8, _ExecuteStmt@GOTPAGE\n\tldr\tx8, [x8, _ExecuteStmt@GOTPAGEOFF]\n\tldr\tw1, [x8]\n\tbl\t_IsA\n\tsubs\tw8, w0, #0\n\tcset\tw8, ne\n\ttbnz\tw8, #0, LBB0_13\n\tb\tLBB0_3\nLBB0_3:\n\tldur\tx0, [x29, #-72]\n\tadrp\tx8, _PrepareStmt@GOTPAGE\n\tldr\tx8, [x8, _PrepareStmt@GOTPAGEOFF]\n\tldr\tw1, [x8]\n\tbl\t_IsA\n\tsubs\tw8, w0, #0\n\tcset\tw8, ne\n\ttbnz\tw8, #0, LBB0_13\n\tb\tLBB0_4\nLBB0_4:\n\tldur\tx0, [x29, #-72]\n\tadrp\tx8, _DeallocateStmt@GOTPAGE\n\tldr\tx8, [x8, _DeallocateStmt@GOTPAGEOFF]\n\tldr\tw1, [x8]\n\tbl\t_IsA\n\tsubs\tw8, w0, #0\n\tcset\tw8, ne\n\ttbnz\tw8, #0, LBB0_13\n\tb\tLBB0_5\nLBB0_5:\n\tldr\tx1, [sp, #24] ; 8-byte Folded Reload\n\tadd\tx0, sp, #128\n\tmov\tx2, #88\n\tbl\t_memcpy\n\tldur\tw0, [x29, #-76]\n\tbl\t_INSTR_TIME_SET_CURRENT\n\tldr\tx9, [sp, #32] ; 8-byte Folded Reload\n\tldr\tw8, [x9]\n\tadd\tw8, w8, #1\n\tstr\tw8, [x9]\n\tbl\t_PG_TRY\n\tmov\tw8, #1\n\ttbz\tw8, #0, LBB0_7\n\tb\tLBB0_6\nLBB0_6:\n\tldur\tx0, [x29, #-24]\n\tldur\tx1, [x29, #-32]\n\tldur\tw2, [x29, #-36]\n\tldur\tw3, [x29, #-40]\n\tldur\tx4, [x29, #-48]\n\tldur\tx5, [x29, #-56]\n\tldur\tx6, [x29, #-64]\n\tbl\t_prev_ProcessUtility\n\tb\tLBB0_8\nLBB0_7:\n\tldur\tx0, [x29, #-24]\n\tldur\tx1, [x29, #-32]\n\tldur\tw2, [x29, #-36]\n\tldur\tw3, [x29, #-40]\n\tldur\tx4, [x29, #-48]\n\tldur\tx5, [x29, #-56]\n\tldur\tx6, [x29, #-64]\n\tbl\t_standard_ProcessUtility\n\tb\tLBB0_8\nLBB0_8:\n\tbl\t_PG_FINALLY\n\tldr\tx9, [sp, #32] ; 8-byte Folded Reload\n\tldr\tw8, [x9]\n\tsubs\tw8, w8, #1\n\tstr\tw8, [x9]\n\tbl\t_PG_END_TRY\n\tldur\tw0, [x29, #-80]\n\tbl\t_INSTR_TIME_SET_CURRENT\n\tldur\tw0, [x29, #-80]\n\tldur\tw1, [x29, #-76]\n\tbl\t_INSTR_TIME_SUBTRACT\n\tldur\tx8, [x29, #-64]\n\tsubs\tx8, x8, #0\n\tcset\tw8, eq\n\ttbnz\tw8, #0, LBB0_11\n\tb\tLBB0_9\nLBB0_9:\n\tldur\tx0, [x29, #-64]\n\tadrp\tx1, l_.str@PAGE\n\tadd\tx1, x1, l_.str@PAGEOFF\n\tmov\tw2, #5\n\tbl\t_strncmp\n\tsubs\tx8, x0, #0\n\tcset\tw8, ne\n\ttbnz\tw8, #0, LBB0_11\n\tb\tLBB0_10\nLBB0_10:\n\tldur\tx8, [x29, #-64]\n\tadd\tx0, x8, #5\n\tmov\tx1, #0\n\tmov\tw2, #10\n\tbl\t_pg_strtouint64\n\tstur\tx0, [x29, #-88]\n\tb\tLBB0_12\nLBB0_11:\n\tstur\txzr, [x29, #-88]\n\tb\tLBB0_12\nLBB0_12:\n\tldr\tx8, [sp, #24] ; 8-byte Folded Reload\n\tldr\tx9, [x8, #80]\n\tldr\tx10, [sp, #208]\n\tsubs\tx9, x9, x10\n\tadd\tx10, sp, #40\n\tstr\tx10, [sp, #8] ; 8-byte Folded Spill\n\tstr\tx9, [sp, #120]\n\tldr\tx9, [x8, #72]\n\tldr\tx10, [sp, #200]\n\tsubs\tx9, x9, x10\n\tstr\tx9, [sp, #112]\n\tldr\tx9, [x8, #64]\n\tldr\tx10, [sp, #192]\n\tsubs\tx9, x9, x10\n\tstr\tx9, [sp, #104]\n\tldr\tx9, [x8, #56]\n\tldr\tx10, [sp, #184]\n\tsubs\tx9, x9, x10\n\tstr\tx9, [sp, #96]\n\tldr\tx9, [x8, #48]\n\tldr\tx10, [sp, #176]\n\tsubs\tx9, x9, x10\n\tstr\tx9, [sp, #88]\n\tldr\tx9, [x8, #40]\n\tldr\tx10, [sp, #168]\n\tsubs\tx9, x9, x10\n\tstr\tx9, [sp, #80]\n\tldr\tx9, [x8, #32]\n\tldr\tx10, [sp, #160]\n\tsubs\tx9, x9, x10\n\tstr\tx9, [sp, #72]\n\tldr\tx9, [x8, #24]\n\tldr\tx10, [sp, #152]\n\tsubs\tx9, x9, x10\n\tstr\tx9, [sp, #64]\n\tldr\tx9, [x8, #16]\n\tldr\tx10, [sp, #144]\n\tsubs\tx9, x9, x10\n\tstr\tx9, [sp, #56]\n\tldr\tx9, [x8, #8]\n\tldr\tx10, [sp, #136]\n\tsubs\tx9, x9, x10\n\tstr\tx9, [sp, #48]\n\tldr\tw8, [x8, #4]\n\tstr\tw8, [sp, #44]\n\tldr\tw0, [sp, #44]\n\tldr\tw1, [sp, #132]\n\tbl\t_INSTR_TIME_SUBTRACT\n\tldr\tx8, [sp, #24] ; 8-byte Folded Reload\n\tldr\tw8, [x8]\n\tstr\tw8, [sp, #40]\n\tldr\tw0, [sp, #40]\n\tldr\tw1, [sp, #128]\n\tbl\t_INSTR_TIME_SUBTRACT\n\tldur\tx8, [x29, #-32]\n\tstr\tx8, [sp, #16] ; 8-byte Folded Spill\n\tldur\tx8, [x29, #-24]\n\tldr\tw8, [x8, #4]\n\tstr\tw8, [sp] ; 4-byte Folded Spill\n\tldur\tx8, [x29, #-24]\n\tldr\tw8, [x8]\n\tstr\tw8, [sp, #4] ; 4-byte Folded Spill\n\tldur\tw0, [x29, #-80]\n\tbl\t_INSTR_TIME_GET_MILLISEC\n\tldr\tw2, [sp] ; 4-byte Folded Reload\n\tldr\tw3, [sp, #4] ; 4-byte Folded Reload\n\tldr\tx6, [sp, #8] ; 8-byte Folded Reload\n\tmov\tx4, x0\n\tldr\tx0, [sp, #16] ; 8-byte Folded Reload\n\n```", "role": "user" }, { "content": "```armasm\n\tldur\tx5, [x29, #-88]\n\tmov\tw1, #0\n\tmov\tx7, #0\n\tbl\t_pgss_store\n\tb\tLBB0_17\nLBB0_13:\n\tmov\tw8, #1\n\ttbz\tw8, #0, LBB0_15\n\tb\tLBB0_14\nLBB0_14:\n\tldur\tx0, [x29, #-24]\n\tldur\tx1, [x29, #-32]\n\tldur\tw2, [x29, #-36]\n\tldur\tw3, [x29, #-40]\n\tldur\tx4, [x29, #-48]\n\tldur\tx5, [x29, #-56]\n```", "role": "assistant" } ]
extr_pg_stat_statements.c_pgss_ProcessUtility.c
[ { "content": "You are given an x86 assembly block (<block>) to traspile into armv8_64 assembly.\nYou are also given the context for this block in the form of pre-context (<pre_context>) and post-context (<post_context>).\nThere is also a pre-target-context (<pre_target>) which is the context for the target block. Use the input pre and post context along with the target pre context to transpile the block from x86 to armv8_64.\n\n```x86asm\n; <pre-context>\n\tmovq\t-16(%rbp), %rsi\n\tmovl\t-20(%rbp), %edx\n\tmovl\t-24(%rbp), %ecx\n\tmovq\t-32(%rbp), %r8\n\tmovq\t-40(%rbp), %r9\n\n; <block>\n\tmovq\t16(%rbp), %rax\n\tmovq\t%rax, (%rsp)\n\tcallq\tprev_ProcessUtility@PLT\n\tjmp\t.LBB0_16\n.LBB0_15:\n\tmovq\t-8(%rbp), %rdi\n\tmovq\t-16(%rbp), %rsi\n\tmovl\t-20(%rbp), %edx\n\tmovl\t-24(%rbp), %ecx\n\tmovq\t-32(%rbp), %r8\n\tmovq\t-40(%rbp), %r9\n\tmovq\t16(%rbp), %rax\n\tmovq\t%rax, (%rsp)\n\tcallq\tstandard_ProcessUtility@PLT\n.LBB0_16:\n\n; <post-context>\n\tjmp\t.LBB0_17\n.LBB0_17:\n\taddq\t$272, %rsp # imm = 0x110\n\tpopq\t%rbp\n\t.cfi_def_cfa %rsp, 8\n\tretq\n.Lfunc_end0:\n\t.size\tpgss_ProcessUtility, .Lfunc_end0-pgss_ProcessUtility\n\t.cfi_endproc\n # -- End function\n\t.type\tpgss_track_utility,@object # @pgss_track_utility\n\t.bss\n\t.globl\tpgss_track_utility\n\t.p2align\t3, 0x0\npgss_track_utility:\n\t.quad\t0 # 0x0\n\t.size\tpgss_track_utility, 8\n\n\t.type\tExecuteStmt,@object # @ExecuteStmt\n\t.globl\tExecuteStmt\n\t.p2align\t2, 0x0\nExecuteStmt:\n\t.long\t0 # 0x0\n\t.size\tExecuteStmt, 4\n\n\t.type\tPrepareStmt,@object # @PrepareStmt\n\t.globl\tPrepareStmt\n\t.p2align\t2, 0x0\nPrepareStmt:\n\t.long\t0 # 0x0\n\t.size\tPrepareStmt, 4\n\n\t.type\tDeallocateStmt,@object # @DeallocateStmt\n\t.globl\tDeallocateStmt\n\t.p2align\t2, 0x0\nDeallocateStmt:\n\t.long\t0 # 0x0\n\t.size\tDeallocateStmt, 4\n\n\t.type\tpgBufferUsage,@object # @pgBufferUsage\n\t.globl\tpgBufferUsage\n\t.p2align\t3, 0x0\npgBufferUsage:\n\t.zero\t88\n\t.size\tpgBufferUsage, 88\n\n\t.type\tnested_level,@object # @nested_level\n\t.globl\tnested_level\n\t.p2align\t2, 0x0\nnested_level:\n\t.long\t0 # 0x0\n\t.size\tnested_level, 4\n\n\t.type\t.L.str,@object # @.str\n\t.section\t.rodata.str1.1,\"aMS\",@progbits,1\n.L.str:\n\t.asciz\t\"COPY \"\n\t.size\t.L.str, 6\n\n\t.ident\t\"Ubuntu clang version 18.1.3 (1ubuntu1)\"\n\t.section\t\".note.GNU-stack\",\"\",@progbits\n\t.addrsig\n\t.addrsig_sym pgss_ProcessUtility\n\t.addrsig_sym pgss_enabled\n\t.addrsig_sym IsA\n\t.addrsig_sym INSTR_TIME_SET_CURRENT\n\t.addrsig_sym PG_TRY\n\t.addrsig_sym prev_ProcessUtility\n\t.addrsig_sym standard_ProcessUtility\n\t.addrsig_sym PG_FINALLY\n\t.addrsig_sym PG_END_TRY\n\t.addrsig_sym INSTR_TIME_SUBTRACT\n\t.addrsig_sym strncmp\n\t.addrsig_sym pg_strtouint64\n\t.addrsig_sym pgss_store\n\t.addrsig_sym INSTR_TIME_GET_MILLISEC\n\t.addrsig_sym pgss_track_utility\n\t.addrsig_sym ExecuteStmt\n\t.addrsig_sym PrepareStmt\n\t.addrsig_sym DeallocateStmt\n\t.addrsig_sym pgBufferUsage\n\t.addrsig_sym nested_level\n\n```\n\n```armasm\n; <pre-target>\n\t.cfi_startproc\n; %bb.0:\n\tsub\tsp, sp, #320\n\t.cfi_def_cfa_offset 320\n\tstp\tx28, x27, [sp, #288] ; 16-byte Folded Spill\n\tstp\tx29, x30, [sp, #304] ; 16-byte Folded Spill\n\tadd\tx29, sp, #304\n\t.cfi_def_cfa w29, 16\n\t.cfi_offset w30, -8\n\t.cfi_offset w29, -16\n\t.cfi_offset w27, -24\n\t.cfi_offset w28, -32\n\tadrp\tx8, _pgBufferUsage@GOTPAGE\n\tldr\tx8, [x8, _pgBufferUsage@GOTPAGEOFF]\n\tstr\tx8, [sp, #24] ; 8-byte Folded Spill\n\tadrp\tx8, _nested_level@GOTPAGE\n\tldr\tx8, [x8, _nested_level@GOTPAGEOFF]\n\tstr\tx8, [sp, #32] ; 8-byte Folded Spill\n\tstur\tx0, [x29, #-24]\n\tstur\tx1, [x29, #-32]\n\tstur\tw2, [x29, #-36]\n\tstur\tw3, [x29, #-40]\n\tstur\tx4, [x29, #-48]\n\tstur\tx5, [x29, #-56]\n\tstur\tx6, [x29, #-64]\n\tldur\tx8, [x29, #-24]\n\tldr\tx8, [x8, #8]\n\tstur\tx8, [x29, #-72]\n\tadrp\tx8, _pgss_track_utility@GOTPAGE\n\tldr\tx8, [x8, _pgss_track_utility@GOTPAGEOFF]\n\tldr\tx8, [x8]\n\tsubs\tx8, x8, #0\n\tcset\tw8, eq\n\ttbnz\tw8, #0, LBB0_13\n\tb\tLBB0_1\nLBB0_1:\n\tbl\t_pgss_enabled\n\tsubs\tx8, x0, #0\n\tcset\tw8, eq\n\ttbnz\tw8, #0, LBB0_13\n\tb\tLBB0_2\nLBB0_2:\n\tldur\tx0, [x29, #-72]\n\tadrp\tx8, _ExecuteStmt@GOTPAGE\n\tldr\tx8, [x8, _ExecuteStmt@GOTPAGEOFF]\n\tldr\tw1, [x8]\n\tbl\t_IsA\n\tsubs\tw8, w0, #0\n\tcset\tw8, ne\n\ttbnz\tw8, #0, LBB0_13\n\tb\tLBB0_3\nLBB0_3:\n\tldur\tx0, [x29, #-72]\n\tadrp\tx8, _PrepareStmt@GOTPAGE\n\tldr\tx8, [x8, _PrepareStmt@GOTPAGEOFF]\n\tldr\tw1, [x8]\n\tbl\t_IsA\n\tsubs\tw8, w0, #0\n\tcset\tw8, ne\n\ttbnz\tw8, #0, LBB0_13\n\tb\tLBB0_4\nLBB0_4:\n\tldur\tx0, [x29, #-72]\n\tadrp\tx8, _DeallocateStmt@GOTPAGE\n\tldr\tx8, [x8, _DeallocateStmt@GOTPAGEOFF]\n\tldr\tw1, [x8]\n\tbl\t_IsA\n\tsubs\tw8, w0, #0\n\tcset\tw8, ne\n\ttbnz\tw8, #0, LBB0_13\n\tb\tLBB0_5\nLBB0_5:\n\tldr\tx1, [sp, #24] ; 8-byte Folded Reload\n\tadd\tx0, sp, #128\n\tmov\tx2, #88\n\tbl\t_memcpy\n\tldur\tw0, [x29, #-76]\n\tbl\t_INSTR_TIME_SET_CURRENT\n\tldr\tx9, [sp, #32] ; 8-byte Folded Reload\n\tldr\tw8, [x9]\n\tadd\tw8, w8, #1\n\tstr\tw8, [x9]\n\tbl\t_PG_TRY\n\tmov\tw8, #1\n\ttbz\tw8, #0, LBB0_7\n\tb\tLBB0_6\nLBB0_6:\n\tldur\tx0, [x29, #-24]\n\tldur\tx1, [x29, #-32]\n\tldur\tw2, [x29, #-36]\n\tldur\tw3, [x29, #-40]\n\tldur\tx4, [x29, #-48]\n\tldur\tx5, [x29, #-56]\n\tldur\tx6, [x29, #-64]\n\tbl\t_prev_ProcessUtility\n\tb\tLBB0_8\nLBB0_7:\n\tldur\tx0, [x29, #-24]\n\tldur\tx1, [x29, #-32]\n\tldur\tw2, [x29, #-36]\n\tldur\tw3, [x29, #-40]\n\tldur\tx4, [x29, #-48]\n\tldur\tx5, [x29, #-56]\n\tldur\tx6, [x29, #-64]\n\tbl\t_standard_ProcessUtility\n\tb\tLBB0_8\nLBB0_8:\n\tbl\t_PG_FINALLY\n\tldr\tx9, [sp, #32] ; 8-byte Folded Reload\n\tldr\tw8, [x9]\n\tsubs\tw8, w8, #1\n\tstr\tw8, [x9]\n\tbl\t_PG_END_TRY\n\tldur\tw0, [x29, #-80]\n\tbl\t_INSTR_TIME_SET_CURRENT\n\tldur\tw0, [x29, #-80]\n\tldur\tw1, [x29, #-76]\n\tbl\t_INSTR_TIME_SUBTRACT\n\tldur\tx8, [x29, #-64]\n\tsubs\tx8, x8, #0\n\tcset\tw8, eq\n\ttbnz\tw8, #0, LBB0_11\n\tb\tLBB0_9\nLBB0_9:\n\tldur\tx0, [x29, #-64]\n\tadrp\tx1, l_.str@PAGE\n\tadd\tx1, x1, l_.str@PAGEOFF\n\tmov\tw2, #5\n\tbl\t_strncmp\n\tsubs\tx8, x0, #0\n\tcset\tw8, ne\n\ttbnz\tw8, #0, LBB0_11\n\tb\tLBB0_10\nLBB0_10:\n\tldur\tx8, [x29, #-64]\n\tadd\tx0, x8, #5\n\tmov\tx1, #0\n\tmov\tw2, #10\n\tbl\t_pg_strtouint64\n\tstur\tx0, [x29, #-88]\n\tb\tLBB0_12\nLBB0_11:\n\tstur\txzr, [x29, #-88]\n\tb\tLBB0_12\nLBB0_12:\n\tldr\tx8, [sp, #24] ; 8-byte Folded Reload\n\tldr\tx9, [x8, #80]\n\tldr\tx10, [sp, #208]\n\tsubs\tx9, x9, x10\n\tadd\tx10, sp, #40\n\tstr\tx10, [sp, #8] ; 8-byte Folded Spill\n\tstr\tx9, [sp, #120]\n\tldr\tx9, [x8, #72]\n\tldr\tx10, [sp, #200]\n\tsubs\tx9, x9, x10\n\tstr\tx9, [sp, #112]\n\tldr\tx9, [x8, #64]\n\tldr\tx10, [sp, #192]\n\tsubs\tx9, x9, x10\n\tstr\tx9, [sp, #104]\n\tldr\tx9, [x8, #56]\n\tldr\tx10, [sp, #184]\n\tsubs\tx9, x9, x10\n\tstr\tx9, [sp, #96]\n\tldr\tx9, [x8, #48]\n\tldr\tx10, [sp, #176]\n\tsubs\tx9, x9, x10\n\tstr\tx9, [sp, #88]\n\tldr\tx9, [x8, #40]\n\tldr\tx10, [sp, #168]\n\tsubs\tx9, x9, x10\n\tstr\tx9, [sp, #80]\n\tldr\tx9, [x8, #32]\n\tldr\tx10, [sp, #160]\n\tsubs\tx9, x9, x10\n\tstr\tx9, [sp, #72]\n\tldr\tx9, [x8, #24]\n\tldr\tx10, [sp, #152]\n\tsubs\tx9, x9, x10\n\tstr\tx9, [sp, #64]\n\tldr\tx9, [x8, #16]\n\tldr\tx10, [sp, #144]\n\tsubs\tx9, x9, x10\n\tstr\tx9, [sp, #56]\n\tldr\tx9, [x8, #8]\n\tldr\tx10, [sp, #136]\n\tsubs\tx9, x9, x10\n\tstr\tx9, [sp, #48]\n\tldr\tw8, [x8, #4]\n\tstr\tw8, [sp, #44]\n\tldr\tw0, [sp, #44]\n\tldr\tw1, [sp, #132]\n\tbl\t_INSTR_TIME_SUBTRACT\n\tldr\tx8, [sp, #24] ; 8-byte Folded Reload\n\tldr\tw8, [x8]\n\tstr\tw8, [sp, #40]\n\tldr\tw0, [sp, #40]\n\tldr\tw1, [sp, #128]\n\tbl\t_INSTR_TIME_SUBTRACT\n\tldur\tx8, [x29, #-32]\n\tstr\tx8, [sp, #16] ; 8-byte Folded Spill\n\tldur\tx8, [x29, #-24]\n\tldr\tw8, [x8, #4]\n\tstr\tw8, [sp] ; 4-byte Folded Spill\n\tldur\tx8, [x29, #-24]\n\tldr\tw8, [x8]\n\tstr\tw8, [sp, #4] ; 4-byte Folded Spill\n\tldur\tw0, [x29, #-80]\n\tbl\t_INSTR_TIME_GET_MILLISEC\n\tldr\tw2, [sp] ; 4-byte Folded Reload\n\tldr\tw3, [sp, #4] ; 4-byte Folded Reload\n\tldr\tx6, [sp, #8] ; 8-byte Folded Reload\n\tmov\tx4, x0\n\tldr\tx0, [sp, #16] ; 8-byte Folded Reload\n\tldur\tx5, [x29, #-88]\n\tmov\tw1, #0\n\tmov\tx7, #0\n\tbl\t_pgss_store\n\tb\tLBB0_17\nLBB0_13:\n\tmov\tw8, #1\n\ttbz\tw8, #0, LBB0_15\n\tb\tLBB0_14\nLBB0_14:\n\tldur\tx0, [x29, #-24]\n\tldur\tx1, [x29, #-32]\n\tldur\tw2, [x29, #-36]\n\tldur\tw3, [x29, #-40]\n\tldur\tx4, [x29, #-48]\n\tldur\tx5, [x29, #-56]\n\n```", "role": "user" }, { "content": "```armasm\n\tldur\tx6, [x29, #-64]\n\tbl\t_prev_ProcessUtility\n\tb\tLBB0_16\nLBB0_15:\n\tldur\tx0, [x29, #-24]\n\tldur\tx1, [x29, #-32]\n\tldur\tw2, [x29, #-36]\n\tldur\tw3, [x29, #-40]\n\tldur\tx4, [x29, #-48]\n\tldur\tx5, [x29, #-56]\n\tldur\tx6, [x29, #-64]\n\tbl\t_standard_ProcessUtility\n\tb\tLBB0_16\nLBB0_16:\n```", "role": "assistant" } ]
extr_pg_stat_statements.c_pgss_ProcessUtility.c
[ { "content": "You are given an x86 assembly block (<block>) to traspile into armv8_64 assembly.\nYou are also given the context for this block in the form of pre-context (<pre_context>) and post-context (<post_context>).\nThere is also a pre-target-context (<pre_target>) which is the context for the target block. Use the input pre and post context along with the target pre context to transpile the block from x86 to armv8_64.\n\n```x86asm\n; <pre-context>\n\tmovl\t-24(%rbp), %ecx\n\tmovq\t-32(%rbp), %r8\n\tmovq\t-40(%rbp), %r9\n\tmovq\t16(%rbp), %rax\n\tmovq\t%rax, (%rsp)\n\tcallq\tstandard_ProcessUtility@PLT\n.LBB0_16:\n\n; <block>\n\tjmp\t.LBB0_17\n.LBB0_17:\n\taddq\t$272, %rsp # imm = 0x110\n\tpopq\t%rbp\n\t.cfi_def_cfa %rsp, 8\n\tretq\n.Lfunc_end0:\n\t.size\tpgss_ProcessUtility, .Lfunc_end0-pgss_ProcessUtility\n\t.cfi_endproc\n # -- End function\n\t.type\tpgss_track_utility,@object # @pgss_track_utility\n\t.bss\n\t.globl\tpgss_track_utility\n\t.p2align\t3, 0x0\npgss_track_utility:\n\t.quad\t0 # 0x0\n\t.size\tpgss_track_utility, 8\n\n\t.type\tExecuteStmt,@object # @ExecuteStmt\n\t.globl\tExecuteStmt\n\t.p2align\t2, 0x0\nExecuteStmt:\n\t.long\t0 # 0x0\n\t.size\tExecuteStmt, 4\n\n\t.type\tPrepareStmt,@object # @PrepareStmt\n\t.globl\tPrepareStmt\n\t.p2align\t2, 0x0\nPrepareStmt:\n\t.long\t0 # 0x0\n\t.size\tPrepareStmt, 4\n\n\t.type\tDeallocateStmt,@object # @DeallocateStmt\n\t.globl\tDeallocateStmt\n\t.p2align\t2, 0x0\nDeallocateStmt:\n\t.long\t0 # 0x0\n\t.size\tDeallocateStmt, 4\n\n\t.type\tpgBufferUsage,@object # @pgBufferUsage\n\t.globl\tpgBufferUsage\n\t.p2align\t3, 0x0\npgBufferUsage:\n\t.zero\t88\n\t.size\tpgBufferUsage, 88\n\n\t.type\tnested_level,@object # @nested_level\n\t.globl\tnested_level\n\t.p2align\t2, 0x0\nnested_level:\n\t.long\t0 # 0x0\n\t.size\tnested_level, 4\n\n\t.type\t.L.str,@object # @.str\n\t.section\t.rodata.str1.1,\"aMS\",@progbits,1\n.L.str:\n\t.asciz\t\"COPY \"\n\t.size\t.L.str, 6\n\n\t.ident\t\"Ubuntu clang version 18.1.3 (1ubuntu1)\"\n\t.section\t\".note.GNU-stack\",\"\",@progbits\n\t.addrsig\n\t.addrsig_sym pgss_ProcessUtility\n\t.addrsig_sym pgss_enabled\n\t.addrsig_sym IsA\n\t.addrsig_sym INSTR_TIME_SET_CURRENT\n\t.addrsig_sym PG_TRY\n\t.addrsig_sym prev_ProcessUtility\n\t.addrsig_sym standard_ProcessUtility\n\t.addrsig_sym PG_FINALLY\n\t.addrsig_sym PG_END_TRY\n\t.addrsig_sym INSTR_TIME_SUBTRACT\n\t.addrsig_sym strncmp\n\t.addrsig_sym pg_strtouint64\n\t.addrsig_sym pgss_store\n\t.addrsig_sym INSTR_TIME_GET_MILLISEC\n\t.addrsig_sym pgss_track_utility\n\t.addrsig_sym ExecuteStmt\n\t.addrsig_sym PrepareStmt\n\t.addrsig_sym DeallocateStmt\n\t.addrsig_sym pgBufferUsage\n\t.addrsig_sym nested_level\n\n; <post-context>\n\n```\n\n```armasm\n; <pre-target>\n\t.cfi_startproc\n; %bb.0:\n\tsub\tsp, sp, #320\n\t.cfi_def_cfa_offset 320\n\tstp\tx28, x27, [sp, #288] ; 16-byte Folded Spill\n\tstp\tx29, x30, [sp, #304] ; 16-byte Folded Spill\n\tadd\tx29, sp, #304\n\t.cfi_def_cfa w29, 16\n\t.cfi_offset w30, -8\n\t.cfi_offset w29, -16\n\t.cfi_offset w27, -24\n\t.cfi_offset w28, -32\n\tadrp\tx8, _pgBufferUsage@GOTPAGE\n\tldr\tx8, [x8, _pgBufferUsage@GOTPAGEOFF]\n\tstr\tx8, [sp, #24] ; 8-byte Folded Spill\n\tadrp\tx8, _nested_level@GOTPAGE\n\tldr\tx8, [x8, _nested_level@GOTPAGEOFF]\n\tstr\tx8, [sp, #32] ; 8-byte Folded Spill\n\tstur\tx0, [x29, #-24]\n\tstur\tx1, [x29, #-32]\n\tstur\tw2, [x29, #-36]\n\tstur\tw3, [x29, #-40]\n\tstur\tx4, [x29, #-48]\n\tstur\tx5, [x29, #-56]\n\tstur\tx6, [x29, #-64]\n\tldur\tx8, [x29, #-24]\n\tldr\tx8, [x8, #8]\n\tstur\tx8, [x29, #-72]\n\tadrp\tx8, _pgss_track_utility@GOTPAGE\n\tldr\tx8, [x8, _pgss_track_utility@GOTPAGEOFF]\n\tldr\tx8, [x8]\n\tsubs\tx8, x8, #0\n\tcset\tw8, eq\n\ttbnz\tw8, #0, LBB0_13\n\tb\tLBB0_1\nLBB0_1:\n\tbl\t_pgss_enabled\n\tsubs\tx8, x0, #0\n\tcset\tw8, eq\n\ttbnz\tw8, #0, LBB0_13\n\tb\tLBB0_2\nLBB0_2:\n\tldur\tx0, [x29, #-72]\n\tadrp\tx8, _ExecuteStmt@GOTPAGE\n\tldr\tx8, [x8, _ExecuteStmt@GOTPAGEOFF]\n\tldr\tw1, [x8]\n\tbl\t_IsA\n\tsubs\tw8, w0, #0\n\tcset\tw8, ne\n\ttbnz\tw8, #0, LBB0_13\n\tb\tLBB0_3\nLBB0_3:\n\tldur\tx0, [x29, #-72]\n\tadrp\tx8, _PrepareStmt@GOTPAGE\n\tldr\tx8, [x8, _PrepareStmt@GOTPAGEOFF]\n\tldr\tw1, [x8]\n\tbl\t_IsA\n\tsubs\tw8, w0, #0\n\tcset\tw8, ne\n\ttbnz\tw8, #0, LBB0_13\n\tb\tLBB0_4\nLBB0_4:\n\tldur\tx0, [x29, #-72]\n\tadrp\tx8, _DeallocateStmt@GOTPAGE\n\tldr\tx8, [x8, _DeallocateStmt@GOTPAGEOFF]\n\tldr\tw1, [x8]\n\tbl\t_IsA\n\tsubs\tw8, w0, #0\n\tcset\tw8, ne\n\ttbnz\tw8, #0, LBB0_13\n\tb\tLBB0_5\nLBB0_5:\n\tldr\tx1, [sp, #24] ; 8-byte Folded Reload\n\tadd\tx0, sp, #128\n\tmov\tx2, #88\n\tbl\t_memcpy\n\tldur\tw0, [x29, #-76]\n\tbl\t_INSTR_TIME_SET_CURRENT\n\tldr\tx9, [sp, #32] ; 8-byte Folded Reload\n\tldr\tw8, [x9]\n\tadd\tw8, w8, #1\n\tstr\tw8, [x9]\n\tbl\t_PG_TRY\n\tmov\tw8, #1\n\ttbz\tw8, #0, LBB0_7\n\tb\tLBB0_6\nLBB0_6:\n\tldur\tx0, [x29, #-24]\n\tldur\tx1, [x29, #-32]\n\tldur\tw2, [x29, #-36]\n\tldur\tw3, [x29, #-40]\n\tldur\tx4, [x29, #-48]\n\tldur\tx5, [x29, #-56]\n\tldur\tx6, [x29, #-64]\n\tbl\t_prev_ProcessUtility\n\tb\tLBB0_8\nLBB0_7:\n\tldur\tx0, [x29, #-24]\n\tldur\tx1, [x29, #-32]\n\tldur\tw2, [x29, #-36]\n\tldur\tw3, [x29, #-40]\n\tldur\tx4, [x29, #-48]\n\tldur\tx5, [x29, #-56]\n\tldur\tx6, [x29, #-64]\n\tbl\t_standard_ProcessUtility\n\tb\tLBB0_8\nLBB0_8:\n\tbl\t_PG_FINALLY\n\tldr\tx9, [sp, #32] ; 8-byte Folded Reload\n\tldr\tw8, [x9]\n\tsubs\tw8, w8, #1\n\tstr\tw8, [x9]\n\tbl\t_PG_END_TRY\n\tldur\tw0, [x29, #-80]\n\tbl\t_INSTR_TIME_SET_CURRENT\n\tldur\tw0, [x29, #-80]\n\tldur\tw1, [x29, #-76]\n\tbl\t_INSTR_TIME_SUBTRACT\n\tldur\tx8, [x29, #-64]\n\tsubs\tx8, x8, #0\n\tcset\tw8, eq\n\ttbnz\tw8, #0, LBB0_11\n\tb\tLBB0_9\nLBB0_9:\n\tldur\tx0, [x29, #-64]\n\tadrp\tx1, l_.str@PAGE\n\tadd\tx1, x1, l_.str@PAGEOFF\n\tmov\tw2, #5\n\tbl\t_strncmp\n\tsubs\tx8, x0, #0\n\tcset\tw8, ne\n\ttbnz\tw8, #0, LBB0_11\n\tb\tLBB0_10\nLBB0_10:\n\tldur\tx8, [x29, #-64]\n\tadd\tx0, x8, #5\n\tmov\tx1, #0\n\tmov\tw2, #10\n\tbl\t_pg_strtouint64\n\tstur\tx0, [x29, #-88]\n\tb\tLBB0_12\nLBB0_11:\n\tstur\txzr, [x29, #-88]\n\tb\tLBB0_12\nLBB0_12:\n\tldr\tx8, [sp, #24] ; 8-byte Folded Reload\n\tldr\tx9, [x8, #80]\n\tldr\tx10, [sp, #208]\n\tsubs\tx9, x9, x10\n\tadd\tx10, sp, #40\n\tstr\tx10, [sp, #8] ; 8-byte Folded Spill\n\tstr\tx9, [sp, #120]\n\tldr\tx9, [x8, #72]\n\tldr\tx10, [sp, #200]\n\tsubs\tx9, x9, x10\n\tstr\tx9, [sp, #112]\n\tldr\tx9, [x8, #64]\n\tldr\tx10, [sp, #192]\n\tsubs\tx9, x9, x10\n\tstr\tx9, [sp, #104]\n\tldr\tx9, [x8, #56]\n\tldr\tx10, [sp, #184]\n\tsubs\tx9, x9, x10\n\tstr\tx9, [sp, #96]\n\tldr\tx9, [x8, #48]\n\tldr\tx10, [sp, #176]\n\tsubs\tx9, x9, x10\n\tstr\tx9, [sp, #88]\n\tldr\tx9, [x8, #40]\n\tldr\tx10, [sp, #168]\n\tsubs\tx9, x9, x10\n\tstr\tx9, [sp, #80]\n\tldr\tx9, [x8, #32]\n\tldr\tx10, [sp, #160]\n\tsubs\tx9, x9, x10\n\tstr\tx9, [sp, #72]\n\tldr\tx9, [x8, #24]\n\tldr\tx10, [sp, #152]\n\tsubs\tx9, x9, x10\n\tstr\tx9, [sp, #64]\n\tldr\tx9, [x8, #16]\n\tldr\tx10, [sp, #144]\n\tsubs\tx9, x9, x10\n\tstr\tx9, [sp, #56]\n\tldr\tx9, [x8, #8]\n\tldr\tx10, [sp, #136]\n\tsubs\tx9, x9, x10\n\tstr\tx9, [sp, #48]\n\tldr\tw8, [x8, #4]\n\tstr\tw8, [sp, #44]\n\tldr\tw0, [sp, #44]\n\tldr\tw1, [sp, #132]\n\tbl\t_INSTR_TIME_SUBTRACT\n\tldr\tx8, [sp, #24] ; 8-byte Folded Reload\n\tldr\tw8, [x8]\n\tstr\tw8, [sp, #40]\n\tldr\tw0, [sp, #40]\n\tldr\tw1, [sp, #128]\n\tbl\t_INSTR_TIME_SUBTRACT\n\tldur\tx8, [x29, #-32]\n\tstr\tx8, [sp, #16] ; 8-byte Folded Spill\n\tldur\tx8, [x29, #-24]\n\tldr\tw8, [x8, #4]\n\tstr\tw8, [sp] ; 4-byte Folded Spill\n\tldur\tx8, [x29, #-24]\n\tldr\tw8, [x8]\n\tstr\tw8, [sp, #4] ; 4-byte Folded Spill\n\tldur\tw0, [x29, #-80]\n\tbl\t_INSTR_TIME_GET_MILLISEC\n\tldr\tw2, [sp] ; 4-byte Folded Reload\n\tldr\tw3, [sp, #4] ; 4-byte Folded Reload\n\tldr\tx6, [sp, #8] ; 8-byte Folded Reload\n\tmov\tx4, x0\n\tldr\tx0, [sp, #16] ; 8-byte Folded Reload\n\tldur\tx5, [x29, #-88]\n\tmov\tw1, #0\n\tmov\tx7, #0\n\tbl\t_pgss_store\n\tb\tLBB0_17\nLBB0_13:\n\tmov\tw8, #1\n\ttbz\tw8, #0, LBB0_15\n\tb\tLBB0_14\nLBB0_14:\n\tldur\tx0, [x29, #-24]\n\tldur\tx1, [x29, #-32]\n\tldur\tw2, [x29, #-36]\n\tldur\tw3, [x29, #-40]\n\tldur\tx4, [x29, #-48]\n\tldur\tx5, [x29, #-56]\n\tldur\tx6, [x29, #-64]\n\tbl\t_prev_ProcessUtility\n\tb\tLBB0_16\nLBB0_15:\n\tldur\tx0, [x29, #-24]\n\tldur\tx1, [x29, #-32]\n\tldur\tw2, [x29, #-36]\n\tldur\tw3, [x29, #-40]\n\tldur\tx4, [x29, #-48]\n\tldur\tx5, [x29, #-56]\n\tldur\tx6, [x29, #-64]\n\tbl\t_standard_ProcessUtility\n\tb\tLBB0_16\nLBB0_16:\n\n```", "role": "user" }, { "content": "```armasm\n\tb\tLBB0_17\nLBB0_17:\n\tldp\tx29, x30, [sp, #304] ; 16-byte Folded Reload\n\tldp\tx28, x27, [sp, #288] ; 16-byte Folded Reload\n\tadd\tsp, sp, #320\n\tret\n\t.cfi_endproc\n ; -- End function\n\t.comm\t_pgss_track_utility,8,3 ; @pgss_track_utility\n\t.comm\t_ExecuteStmt,4,2 ; @ExecuteStmt\n\t.comm\t_PrepareStmt,4,2 ; @PrepareStmt\n\t.comm\t_DeallocateStmt,4,2 ; @DeallocateStmt\n\t.comm\t_pgBufferUsage,88,3 ; @pgBufferUsage\n\t.comm\t_nested_level,4,2 ; @nested_level\n\t.section\t__TEXT,__cstring,cstring_literals\nl_.str: ; @.str\n\t.asciz\t\"COPY \"\n\n\t.no_dead_strip\t_pgss_ProcessUtility\n.subsections_via_symbols\n```", "role": "assistant" } ]
extr_pwhash_argon2id.c_crypto_pwhash_argon2id_alg_argon2id13.c
[ { "content": "You are given an x86 assembly block (<block>) to traspile into armv8_64 assembly.\nYou are also given the context for this block in the form of pre-context (<pre_context>) and post-context (<post_context>).\nThere is also a pre-target-context (<pre_target>) which is the context for the target block. Use the input pre and post context along with the target pre context to transpile the block from x86 to armv8_64.\n\n```x86asm\n; <pre-context>\n\n; <block>\n\t.text\n\t.file\t\"extr_pwhash_argon2id.c_crypto_pwhash_argon2id_alg_argon2id13.c\"\n\t.globl\tcrypto_pwhash_argon2id_alg_argon2id13 # -- Begin function crypto_pwhash_argon2id_alg_argon2id13\n\t.p2align\t4, 0x90\n\t.type\tcrypto_pwhash_argon2id_alg_argon2id13,@function\ncrypto_pwhash_argon2id_alg_argon2id13: # @crypto_pwhash_argon2id_alg_argon2id13\n\t.cfi_startproc\n# %bb.0:\n\tpushq\t%rbp\n\t.cfi_def_cfa_offset 16\n\t.cfi_offset %rbp, -16\n\tmovq\t%rsp, %rbp\n\t.cfi_def_cfa_register %rbp\n\tmovl\tcrypto_pwhash_argon2id_ALG_ARGON2ID13(%rip), %eax\n\tpopq\t%rbp\n\t.cfi_def_cfa %rsp, 8\n\tretq\n.Lfunc_end0:\n\t.size\tcrypto_pwhash_argon2id_alg_argon2id13, .Lfunc_end0-crypto_pwhash_argon2id_alg_argon2id13\n\t.cfi_endproc\n # -- End function\n\t.type\tcrypto_pwhash_argon2id_ALG_ARGON2ID13,@object # @crypto_pwhash_argon2id_ALG_ARGON2ID13\n\t.bss\n\t.globl\tcrypto_pwhash_argon2id_ALG_ARGON2ID13\n\t.p2align\t2, 0x0\ncrypto_pwhash_argon2id_ALG_ARGON2ID13:\n\t.long\t0 # 0x0\n\t.size\tcrypto_pwhash_argon2id_ALG_ARGON2ID13, 4\n\n\t.ident\t\"Ubuntu clang version 18.1.3 (1ubuntu1)\"\n\t.section\t\".note.GNU-stack\",\"\",@progbits\n\t.addrsig\n\t.addrsig_sym crypto_pwhash_argon2id_ALG_ARGON2ID13\n\n; <post-context>\n\n```\n\n```armasm\n; <pre-target>\n\n```", "role": "user" }, { "content": "```armasm\n\t.section\t__TEXT,__text,regular,pure_instructions\n\t.build_version macos, 13, 0\tsdk_version 13, 3\n\t.globl\t_crypto_pwhash_argon2id_alg_argon2id13 ; -- Begin function crypto_pwhash_argon2id_alg_argon2id13\n\t.p2align\t2\n_crypto_pwhash_argon2id_alg_argon2id13: ; @crypto_pwhash_argon2id_alg_argon2id13\n\t.cfi_startproc\n; %bb.0:\n\tadrp\tx8, _crypto_pwhash_argon2id_ALG_ARGON2ID13@GOTPAGE\n\tldr\tx8, [x8, _crypto_pwhash_argon2id_ALG_ARGON2ID13@GOTPAGEOFF]\n\tldr\tw0, [x8]\n\tret\n\t.cfi_endproc\n ; -- End function\n\t.comm\t_crypto_pwhash_argon2id_ALG_ARGON2ID13,4,2 ; @crypto_pwhash_argon2id_ALG_ARGON2ID13\n.subsections_via_symbols\n```", "role": "assistant" } ]
extr_hid-roccat-arvo.c_arvo_raw_event.c
[ { "content": "You are given an x86 assembly block (<block>) to traspile into armv8_64 assembly.\nYou are also given the context for this block in the form of pre-context (<pre_context>) and post-context (<post_context>).\nThere is also a pre-target-context (<pre_target>) which is the context for the target block. Use the input pre and post context along with the target pre context to transpile the block from x86 to armv8_64.\n\n```x86asm\n; <pre-context>\n\n; <block>\n\t.text\n\t.file\t\"extr_hid-roccat-arvo.c_arvo_raw_event.c\"\n\t.p2align\t4, 0x90 # -- Begin function arvo_raw_event\n\t.type\tarvo_raw_event,@function\narvo_raw_event: # @arvo_raw_event\n\t.cfi_startproc\n# %bb.0:\n\tpushq\t%rbp\n\t.cfi_def_cfa_offset 16\n\t.cfi_offset %rbp, -16\n\tmovq\t%rsp, %rbp\n\t.cfi_def_cfa_register %rbp\n\tsubq\t$48, %rsp\n\tmovq\t%rdi, -16(%rbp)\n\tmovq\t%rsi, -24(%rbp)\n\tmovq\t%rdx, -32(%rbp)\n\tmovl\t%ecx, -36(%rbp)\n\tmovq\t-16(%rbp), %rdi\n\tcallq\thid_get_drvdata@PLT\n\tmovq\t%rax, -48(%rbp)\n\tcmpl\t$3, -36(%rbp)\n\tje\t.LBB0_2\n# %bb.1:\n\tmovl\t$0, -4(%rbp)\n\tjmp\t.LBB0_6\n.LBB0_2:\n\tcmpq\t$0, -48(%rbp)\n\tje\t.LBB0_5\n# %bb.3:\n\n; <post-context>\n\tmovq\t-48(%rbp), %rax\n\tcmpq\t$0, (%rax)\n\tje\t.LBB0_5\n# %bb.4:\n\tmovq\t-48(%rbp), %rdi\n\tmovq\t-32(%rbp), %rsi\n\tcallq\tarvo_report_to_chrdev@PLT\n.LBB0_5:\n\n```\n\n```armasm\n; <pre-target>\n\n```", "role": "user" }, { "content": "```armasm\n\t.section\t__TEXT,__text,regular,pure_instructions\n\t.build_version macos, 13, 0\tsdk_version 13, 3\n\t.p2align\t2 ; -- Begin function arvo_raw_event\n_arvo_raw_event: ; @arvo_raw_event\n\t.cfi_startproc\n; %bb.0:\n\tsub\tsp, sp, #64\n\t.cfi_def_cfa_offset 64\n\tstp\tx29, x30, [sp, #48] ; 16-byte Folded Spill\n\tadd\tx29, sp, #48\n\t.cfi_def_cfa w29, 16\n\t.cfi_offset w30, -8\n\t.cfi_offset w29, -16\n\tstur\tx0, [x29, #-16]\n\tstr\tx1, [sp, #24]\n\tstr\tx2, [sp, #16]\n\tstr\tw3, [sp, #12]\n\tldur\tx0, [x29, #-16]\n\tbl\t_hid_get_drvdata\n\tstr\tx0, [sp]\n\tldr\tw8, [sp, #12]\n\tsubs\tw8, w8, #3\n\tcset\tw8, eq\n\ttbnz\tw8, #0, LBB0_2\n\tb\tLBB0_1\nLBB0_1:\n\tstur\twzr, [x29, #-4]\n\tb\tLBB0_6\nLBB0_2:\n\tldr\tx8, [sp]\n\tsubs\tx8, x8, #0\n\tcset\tw8, eq\n\ttbnz\tw8, #0, LBB0_5\n\tb\tLBB0_3\nLBB0_3:\n\tldr\tx8, [sp]\n\tldr\tx8, [x8]\n```", "role": "assistant" } ]
extr_hid-roccat-arvo.c_arvo_raw_event.c
[ { "content": "You are given an x86 assembly block (<block>) to traspile into armv8_64 assembly.\nYou are also given the context for this block in the form of pre-context (<pre_context>) and post-context (<post_context>).\nThere is also a pre-target-context (<pre_target>) which is the context for the target block. Use the input pre and post context along with the target pre context to transpile the block from x86 to armv8_64.\n\n```x86asm\n; <pre-context>\n\tcmpl\t$3, -36(%rbp)\n\tje\t.LBB0_2\n# %bb.1:\n\tmovl\t$0, -4(%rbp)\n\tjmp\t.LBB0_6\n.LBB0_2:\n\tcmpq\t$0, -48(%rbp)\n\tje\t.LBB0_5\n# %bb.3:\n\n; <block>\n\tmovq\t-48(%rbp), %rax\n\tcmpq\t$0, (%rax)\n\tje\t.LBB0_5\n# %bb.4:\n\tmovq\t-48(%rbp), %rdi\n\tmovq\t-32(%rbp), %rsi\n\tcallq\tarvo_report_to_chrdev@PLT\n.LBB0_5:\n\tmovl\t$0, -4(%rbp)\n.LBB0_6:\n\tmovl\t-4(%rbp), %eax\n\taddq\t$48, %rsp\n\tpopq\t%rbp\n\t.cfi_def_cfa %rsp, 8\n\tretq\n.Lfunc_end0:\n\t.size\tarvo_raw_event, .Lfunc_end0-arvo_raw_event\n\t.cfi_endproc\n # -- End function\n\t.ident\t\"Ubuntu clang version 18.1.3 (1ubuntu1)\"\n\t.section\t\".note.GNU-stack\",\"\",@progbits\n\t.addrsig\n\t.addrsig_sym arvo_raw_event\n\t.addrsig_sym hid_get_drvdata\n\t.addrsig_sym arvo_report_to_chrdev\n\n; <post-context>\n\n```\n\n```armasm\n; <pre-target>\n\t.cfi_startproc\n; %bb.0:\n\tsub\tsp, sp, #64\n\t.cfi_def_cfa_offset 64\n\tstp\tx29, x30, [sp, #48] ; 16-byte Folded Spill\n\tadd\tx29, sp, #48\n\t.cfi_def_cfa w29, 16\n\t.cfi_offset w30, -8\n\t.cfi_offset w29, -16\n\tstur\tx0, [x29, #-16]\n\tstr\tx1, [sp, #24]\n\tstr\tx2, [sp, #16]\n\tstr\tw3, [sp, #12]\n\tldur\tx0, [x29, #-16]\n\tbl\t_hid_get_drvdata\n\tstr\tx0, [sp]\n\tldr\tw8, [sp, #12]\n\tsubs\tw8, w8, #3\n\tcset\tw8, eq\n\ttbnz\tw8, #0, LBB0_2\n\tb\tLBB0_1\nLBB0_1:\n\tstur\twzr, [x29, #-4]\n\tb\tLBB0_6\nLBB0_2:\n\tldr\tx8, [sp]\n\tsubs\tx8, x8, #0\n\tcset\tw8, eq\n\ttbnz\tw8, #0, LBB0_5\n\tb\tLBB0_3\nLBB0_3:\n\tldr\tx8, [sp]\n\tldr\tx8, [x8]\n\n```", "role": "user" }, { "content": "```armasm\n\tsubs\tx8, x8, #0\n\tcset\tw8, eq\n\ttbnz\tw8, #0, LBB0_5\n\tb\tLBB0_4\nLBB0_4:\n\tldr\tx0, [sp]\n\tldr\tx1, [sp, #16]\n\tbl\t_arvo_report_to_chrdev\n\tb\tLBB0_5\nLBB0_5:\n\tstur\twzr, [x29, #-4]\n\tb\tLBB0_6\nLBB0_6:\n\tldur\tw0, [x29, #-4]\n\tldp\tx29, x30, [sp, #48] ; 16-byte Folded Reload\n\tadd\tsp, sp, #64\n\tret\n\t.cfi_endproc\n ; -- End function\n\t.no_dead_strip\t_arvo_raw_event\n.subsections_via_symbols\n```", "role": "assistant" } ]
extr_qlcnic_hw.c_qlcnic_ind_rd.c
[ { "content": "You are given an x86 assembly block (<block>) to traspile into armv8_64 assembly.\nYou are also given the context for this block in the form of pre-context (<pre_context>) and post-context (<post_context>).\nThere is also a pre-target-context (<pre_target>) which is the context for the target block. Use the input pre and post context along with the target pre context to transpile the block from x86 to armv8_64.\n\n```x86asm\n; <pre-context>\n\n; <block>\n\t.text\n\t.file\t\"extr_qlcnic_hw.c_qlcnic_ind_rd.c\"\n\t.globl\tqlcnic_ind_rd # -- Begin function qlcnic_ind_rd\n\t.p2align\t4, 0x90\n\t.type\tqlcnic_ind_rd,@function\nqlcnic_ind_rd: # @qlcnic_ind_rd\n\t.cfi_startproc\n# %bb.0:\n\tpushq\t%rbp\n\t.cfi_def_cfa_offset 16\n\t.cfi_offset %rbp, -16\n\tmovq\t%rsp, %rbp\n\t.cfi_def_cfa_register %rbp\n\tsubq\t$32, %rsp\n\tmovq\t%rdi, -16(%rbp)\n\tmovl\t%esi, -20(%rbp)\n\tmovl\t$0, -24(%rbp)\n\tmovq\t-16(%rbp), %rdi\n\tcallq\tqlcnic_82xx_check@PLT\n\tcmpq\t$0, %rax\n\tje\t.LBB0_2\n# %bb.1:\n\tmovl\t-20(%rbp), %edi\n\tmovq\t-16(%rbp), %rax\n\tmovq\t(%rax), %rax\n\tmovl\t(%rax), %esi\n\n; <post-context>\n\tleaq\t-28(%rbp), %rdx\n\tcallq\tqlcnic_read_window_reg@PLT\n\tjmp\t.LBB0_5\n.LBB0_2:\n\tmovq\t-16(%rbp), %rdi\n\tmovl\t-20(%rbp), %esi\n\tleaq\t-24(%rbp), %rdx\n\tcallq\tQLCRD32@PLT\n\tmovl\t%eax, -28(%rbp)\n\n```\n\n```armasm\n; <pre-target>\n\n```", "role": "user" }, { "content": "```armasm\n\t.section\t__TEXT,__text,regular,pure_instructions\n\t.build_version macos, 13, 0\tsdk_version 13, 3\n\t.globl\t_qlcnic_ind_rd ; -- Begin function qlcnic_ind_rd\n\t.p2align\t2\n_qlcnic_ind_rd: ; @qlcnic_ind_rd\n\t.cfi_startproc\n; %bb.0:\n\tsub\tsp, sp, #48\n\t.cfi_def_cfa_offset 48\n\tstp\tx29, x30, [sp, #32] ; 16-byte Folded Spill\n\tadd\tx29, sp, #32\n\t.cfi_def_cfa w29, 16\n\t.cfi_offset w30, -8\n\t.cfi_offset w29, -16\n\tstr\tx0, [sp, #16]\n\tstr\tw1, [sp, #12]\n\tstr\twzr, [sp, #8]\n\tldr\tx0, [sp, #16]\n\tbl\t_qlcnic_82xx_check\n\tsubs\tx8, x0, #0\n\tcset\tw8, eq\n\ttbnz\tw8, #0, LBB0_2\n\tb\tLBB0_1\nLBB0_1:\n\tldr\tw0, [sp, #12]\n\tldr\tx8, [sp, #16]\n\tldr\tx8, [x8]\n\tldr\tw1, [x8]\n\tadd\tx2, sp, #4\n```", "role": "assistant" } ]
extr_qlcnic_hw.c_qlcnic_ind_rd.c
[ { "content": "You are given an x86 assembly block (<block>) to traspile into armv8_64 assembly.\nYou are also given the context for this block in the form of pre-context (<pre_context>) and post-context (<post_context>).\nThere is also a pre-target-context (<pre_target>) which is the context for the target block. Use the input pre and post context along with the target pre context to transpile the block from x86 to armv8_64.\n\n```x86asm\n; <pre-context>\n\tje\t.LBB0_2\n# %bb.1:\n\tmovl\t-20(%rbp), %edi\n\tmovq\t-16(%rbp), %rax\n\tmovq\t(%rax), %rax\n\tmovl\t(%rax), %esi\n\n; <block>\n\tleaq\t-28(%rbp), %rdx\n\tcallq\tqlcnic_read_window_reg@PLT\n\tjmp\t.LBB0_5\n.LBB0_2:\n\tmovq\t-16(%rbp), %rdi\n\tmovl\t-20(%rbp), %esi\n\tleaq\t-24(%rbp), %rdx\n\tcallq\tQLCRD32@PLT\n\tmovl\t%eax, -28(%rbp)\n\tmovl\t-24(%rbp), %eax\n\txorl\t%ecx, %ecx\n\tsubl\tEIO(%rip), %ecx\n\tcmpl\t%ecx, %eax\n\tjne\t.LBB0_4\n# %bb.3:\n\tmovl\t-24(%rbp), %eax\n\tmovl\t%eax, -4(%rbp)\n\tjmp\t.LBB0_6\n.LBB0_4:\n\n; <post-context>\n\tjmp\t.LBB0_5\n.LBB0_5:\n\tmovl\t-28(%rbp), %eax\n\tmovl\t%eax, -4(%rbp)\n.LBB0_6:\n\tmovl\t-4(%rbp), %eax\n\taddq\t$32, %rsp\n\tpopq\t%rbp\n\t.cfi_def_cfa %rsp, 8\n\tretq\n.Lfunc_end0:\n\t.size\tqlcnic_ind_rd, .Lfunc_end0-qlcnic_ind_rd\n\t.cfi_endproc\n # -- End function\n\t.type\tEIO,@object # @EIO\n\t.bss\n\t.globl\tEIO\n\t.p2align\t2, 0x0\nEIO:\n\t.long\t0 # 0x0\n\t.size\tEIO, 4\n\n\t.ident\t\"Ubuntu clang version 18.1.3 (1ubuntu1)\"\n\t.section\t\".note.GNU-stack\",\"\",@progbits\n\t.addrsig\n\t.addrsig_sym qlcnic_82xx_check\n\t.addrsig_sym qlcnic_read_window_reg\n\t.addrsig_sym QLCRD32\n\t.addrsig_sym EIO\n\n```\n\n```armasm\n; <pre-target>\n\t.cfi_startproc\n; %bb.0:\n\tsub\tsp, sp, #48\n\t.cfi_def_cfa_offset 48\n\tstp\tx29, x30, [sp, #32] ; 16-byte Folded Spill\n\tadd\tx29, sp, #32\n\t.cfi_def_cfa w29, 16\n\t.cfi_offset w30, -8\n\t.cfi_offset w29, -16\n\tstr\tx0, [sp, #16]\n\tstr\tw1, [sp, #12]\n\tstr\twzr, [sp, #8]\n\tldr\tx0, [sp, #16]\n\tbl\t_qlcnic_82xx_check\n\tsubs\tx8, x0, #0\n\tcset\tw8, eq\n\ttbnz\tw8, #0, LBB0_2\n\tb\tLBB0_1\nLBB0_1:\n\tldr\tw0, [sp, #12]\n\tldr\tx8, [sp, #16]\n\tldr\tx8, [x8]\n\tldr\tw1, [x8]\n\tadd\tx2, sp, #4\n\n```", "role": "user" }, { "content": "```armasm\n\tbl\t_qlcnic_read_window_reg\n\tb\tLBB0_5\nLBB0_2:\n\tldr\tx0, [sp, #16]\n\tldr\tw1, [sp, #12]\n\tadd\tx2, sp, #8\n\tbl\t_QLCRD32\n\tstr\tw0, [sp, #4]\n\tldr\tw8, [sp, #8]\n\tadrp\tx9, _EIO@GOTPAGE\n\tldr\tx9, [x9, _EIO@GOTPAGEOFF]\n\tldr\tw9, [x9]\n\tadds\tw8, w8, w9\n\tcset\tw8, ne\n\ttbnz\tw8, #0, LBB0_4\n\tb\tLBB0_3\nLBB0_3:\n\tldr\tw8, [sp, #8]\n\tstur\tw8, [x29, #-4]\n\tb\tLBB0_6\nLBB0_4:\n```", "role": "assistant" } ]
extr_qlcnic_hw.c_qlcnic_ind_rd.c
[ { "content": "You are given an x86 assembly block (<block>) to traspile into armv8_64 assembly.\nYou are also given the context for this block in the form of pre-context (<pre_context>) and post-context (<post_context>).\nThere is also a pre-target-context (<pre_target>) which is the context for the target block. Use the input pre and post context along with the target pre context to transpile the block from x86 to armv8_64.\n\n```x86asm\n; <pre-context>\n\tmovl\t-24(%rbp), %eax\n\txorl\t%ecx, %ecx\n\tsubl\tEIO(%rip), %ecx\n\tcmpl\t%ecx, %eax\n\tjne\t.LBB0_4\n# %bb.3:\n\tmovl\t-24(%rbp), %eax\n\tmovl\t%eax, -4(%rbp)\n\tjmp\t.LBB0_6\n.LBB0_4:\n\n; <block>\n\tjmp\t.LBB0_5\n.LBB0_5:\n\tmovl\t-28(%rbp), %eax\n\tmovl\t%eax, -4(%rbp)\n.LBB0_6:\n\tmovl\t-4(%rbp), %eax\n\taddq\t$32, %rsp\n\tpopq\t%rbp\n\t.cfi_def_cfa %rsp, 8\n\tretq\n.Lfunc_end0:\n\t.size\tqlcnic_ind_rd, .Lfunc_end0-qlcnic_ind_rd\n\t.cfi_endproc\n # -- End function\n\t.type\tEIO,@object # @EIO\n\t.bss\n\t.globl\tEIO\n\t.p2align\t2, 0x0\nEIO:\n\t.long\t0 # 0x0\n\t.size\tEIO, 4\n\n\t.ident\t\"Ubuntu clang version 18.1.3 (1ubuntu1)\"\n\t.section\t\".note.GNU-stack\",\"\",@progbits\n\t.addrsig\n\t.addrsig_sym qlcnic_82xx_check\n\t.addrsig_sym qlcnic_read_window_reg\n\t.addrsig_sym QLCRD32\n\t.addrsig_sym EIO\n\n; <post-context>\n\n```\n\n```armasm\n; <pre-target>\n\t.cfi_startproc\n; %bb.0:\n\tsub\tsp, sp, #48\n\t.cfi_def_cfa_offset 48\n\tstp\tx29, x30, [sp, #32] ; 16-byte Folded Spill\n\tadd\tx29, sp, #32\n\t.cfi_def_cfa w29, 16\n\t.cfi_offset w30, -8\n\t.cfi_offset w29, -16\n\tstr\tx0, [sp, #16]\n\tstr\tw1, [sp, #12]\n\tstr\twzr, [sp, #8]\n\tldr\tx0, [sp, #16]\n\tbl\t_qlcnic_82xx_check\n\tsubs\tx8, x0, #0\n\tcset\tw8, eq\n\ttbnz\tw8, #0, LBB0_2\n\tb\tLBB0_1\nLBB0_1:\n\tldr\tw0, [sp, #12]\n\tldr\tx8, [sp, #16]\n\tldr\tx8, [x8]\n\tldr\tw1, [x8]\n\tadd\tx2, sp, #4\n\tbl\t_qlcnic_read_window_reg\n\tb\tLBB0_5\nLBB0_2:\n\tldr\tx0, [sp, #16]\n\tldr\tw1, [sp, #12]\n\tadd\tx2, sp, #8\n\tbl\t_QLCRD32\n\tstr\tw0, [sp, #4]\n\tldr\tw8, [sp, #8]\n\tadrp\tx9, _EIO@GOTPAGE\n\tldr\tx9, [x9, _EIO@GOTPAGEOFF]\n\tldr\tw9, [x9]\n\tadds\tw8, w8, w9\n\tcset\tw8, ne\n\ttbnz\tw8, #0, LBB0_4\n\tb\tLBB0_3\nLBB0_3:\n\tldr\tw8, [sp, #8]\n\tstur\tw8, [x29, #-4]\n\tb\tLBB0_6\nLBB0_4:\n\n```", "role": "user" }, { "content": "```armasm\n\tb\tLBB0_5\nLBB0_5:\n\tldr\tw8, [sp, #4]\n\tstur\tw8, [x29, #-4]\n\tb\tLBB0_6\nLBB0_6:\n\tldur\tw0, [x29, #-4]\n\tldp\tx29, x30, [sp, #32] ; 16-byte Folded Reload\n\tadd\tsp, sp, #48\n\tret\n\t.cfi_endproc\n ; -- End function\n\t.comm\t_EIO,4,2 ; @EIO\n.subsections_via_symbols\n```", "role": "assistant" } ]
extr_imaadp32.c_ADPCM_GetFormatIndex.c
[ { "content": "You are given an x86 assembly block (<block>) to traspile into armv8_64 assembly.\nYou are also given the context for this block in the form of pre-context (<pre_context>) and post-context (<post_context>).\nThere is also a pre-target-context (<pre_target>) which is the context for the target block. Use the input pre and post context along with the target pre context to transpile the block from x86 to armv8_64.\n\n```x86asm\n; <pre-context>\n\n; <block>\n\t.text\n\t.file\t\"extr_imaadp32.c_ADPCM_GetFormatIndex.c\"\n\t.p2align\t4, 0x90 # -- Begin function ADPCM_GetFormatIndex\n\t.type\tADPCM_GetFormatIndex,@function\nADPCM_GetFormatIndex: # @ADPCM_GetFormatIndex\n\t.cfi_startproc\n# %bb.0:\n\tpushq\t%rbp\n\t.cfi_def_cfa_offset 16\n\t.cfi_offset %rbp, -16\n\tmovq\t%rsp, %rbp\n\t.cfi_def_cfa_register %rbp\n\tsubq\t$48, %rsp\n\tmovq\t%rdi, -16(%rbp)\n\tmovq\t-16(%rbp), %rax\n\tmovl\t(%rax), %eax\n\tmovl\t%eax, -36(%rbp) # 4-byte Spill\n\tsubl\t$128, %eax\n\tje\t.LBB0_1\n\tjmp\t.LBB0_28\n.LBB0_28:\n\tmovl\t-36(%rbp), %eax # 4-byte Reload\n\tsubl\t$129, %eax\n\tje\t.LBB0_2\n\tjmp\t.LBB0_3\n.LBB0_1:\n\tmovq\tPCM_Formats(%rip), %rdi\n\tcallq\tARRAY_SIZE@PLT\n\tmovl\t%eax, -24(%rbp)\n\n; <post-context>\n\tmovq\tPCM_Formats(%rip), %rax\n\tmovq\t%rax, -32(%rbp)\n\tjmp\t.LBB0_4\n.LBB0_2:\n\tmovq\tADPCM_Formats(%rip), %rdi\n\tcallq\tARRAY_SIZE@PLT\n\n```\n\n```armasm\n; <pre-target>\n\n```", "role": "user" }, { "content": "```armasm\n\t.section\t__TEXT,__text,regular,pure_instructions\n\t.build_version macos, 13, 0\tsdk_version 13, 3\n\t.p2align\t2 ; -- Begin function ADPCM_GetFormatIndex\n_ADPCM_GetFormatIndex: ; @ADPCM_GetFormatIndex\n\t.cfi_startproc\n; %bb.0:\n\tsub\tsp, sp, #80\n\t.cfi_def_cfa_offset 80\n\tstp\tx29, x30, [sp, #64] ; 16-byte Folded Spill\n\tadd\tx29, sp, #64\n\t.cfi_def_cfa w29, 16\n\t.cfi_offset w30, -8\n\t.cfi_offset w29, -16\n\tstur\tx0, [x29, #-16]\n\tldur\tx8, [x29, #-16]\n\tldr\tw8, [x8]\n\tstr\tw8, [sp, #28] ; 4-byte Folded Spill\n\tsubs\tw8, w8, #128\n\tcset\tw8, eq\n\ttbnz\tw8, #0, LBB0_2\n\tb\tLBB0_1\nLBB0_1:\n\tldr\tw8, [sp, #28] ; 4-byte Folded Reload\n\tsubs\tw8, w8, #129\n\tcset\tw8, eq\n\ttbnz\tw8, #0, LBB0_3\n\tb\tLBB0_4\nLBB0_2:\n\tadrp\tx8, _PCM_Formats@GOTPAGE\n\tldr\tx8, [x8, _PCM_Formats@GOTPAGEOFF]\n\tstr\tx8, [sp, #16] ; 8-byte Folded Spill\n\tldr\tx0, [x8]\n\tbl\t_ARRAY_SIZE\n\tldr\tx8, [sp, #16] ; 8-byte Folded Reload\n\tstur\tw0, [x29, #-24]\n```", "role": "assistant" } ]
extr_imaadp32.c_ADPCM_GetFormatIndex.c
[ { "content": "You are given an x86 assembly block (<block>) to traspile into armv8_64 assembly.\nYou are also given the context for this block in the form of pre-context (<pre_context>) and post-context (<post_context>).\nThere is also a pre-target-context (<pre_target>) which is the context for the target block. Use the input pre and post context along with the target pre context to transpile the block from x86 to armv8_64.\n\n```x86asm\n; <pre-context>\n\tmovl\t-36(%rbp), %eax # 4-byte Reload\n\tsubl\t$129, %eax\n\tje\t.LBB0_2\n\tjmp\t.LBB0_3\n.LBB0_1:\n\tmovq\tPCM_Formats(%rip), %rdi\n\tcallq\tARRAY_SIZE@PLT\n\tmovl\t%eax, -24(%rbp)\n\n; <block>\n\tmovq\tPCM_Formats(%rip), %rax\n\tmovq\t%rax, -32(%rbp)\n\tjmp\t.LBB0_4\n.LBB0_2:\n\tmovq\tADPCM_Formats(%rip), %rdi\n\tcallq\tARRAY_SIZE@PLT\n\tmovl\t%eax, -24(%rbp)\n\tmovq\tADPCM_Formats(%rip), %rax\n\tmovq\t%rax, -32(%rbp)\n\tjmp\t.LBB0_4\n.LBB0_3:\n\tmovl\t$-1, -4(%rbp)\n\tjmp\t.LBB0_27\n.LBB0_4:\n\n; <post-context>\n\tmovl\t$0, -20(%rbp)\n.LBB0_5: # =>This Inner Loop Header: Depth=1\n\tmovl\t-20(%rbp), %eax\n\tcmpl\t-24(%rbp), %eax\n\tjge\t.LBB0_12\n# %bb.6: # in Loop: Header=BB0_5 Depth=1\n\tmovq\t-16(%rbp), %rax\n\n```\n\n```armasm\n; <pre-target>\n\t.cfi_startproc\n; %bb.0:\n\tsub\tsp, sp, #80\n\t.cfi_def_cfa_offset 80\n\tstp\tx29, x30, [sp, #64] ; 16-byte Folded Spill\n\tadd\tx29, sp, #64\n\t.cfi_def_cfa w29, 16\n\t.cfi_offset w30, -8\n\t.cfi_offset w29, -16\n\tstur\tx0, [x29, #-16]\n\tldur\tx8, [x29, #-16]\n\tldr\tw8, [x8]\n\tstr\tw8, [sp, #28] ; 4-byte Folded Spill\n\tsubs\tw8, w8, #128\n\tcset\tw8, eq\n\ttbnz\tw8, #0, LBB0_2\n\tb\tLBB0_1\nLBB0_1:\n\tldr\tw8, [sp, #28] ; 4-byte Folded Reload\n\tsubs\tw8, w8, #129\n\tcset\tw8, eq\n\ttbnz\tw8, #0, LBB0_3\n\tb\tLBB0_4\nLBB0_2:\n\tadrp\tx8, _PCM_Formats@GOTPAGE\n\tldr\tx8, [x8, _PCM_Formats@GOTPAGEOFF]\n\tstr\tx8, [sp, #16] ; 8-byte Folded Spill\n\tldr\tx0, [x8]\n\tbl\t_ARRAY_SIZE\n\tldr\tx8, [sp, #16] ; 8-byte Folded Reload\n\tstur\tw0, [x29, #-24]\n\n```", "role": "user" }, { "content": "```armasm\n\tldr\tx8, [x8]\n\tstr\tx8, [sp, #32]\n\tb\tLBB0_5\nLBB0_3:\n\tadrp\tx8, _ADPCM_Formats@GOTPAGE\n\tldr\tx8, [x8, _ADPCM_Formats@GOTPAGEOFF]\n\tstr\tx8, [sp, #8] ; 8-byte Folded Spill\n\tldr\tx0, [x8]\n\tbl\t_ARRAY_SIZE\n\tldr\tx8, [sp, #8] ; 8-byte Folded Reload\n\tstur\tw0, [x29, #-24]\n\tldr\tx8, [x8]\n\tstr\tx8, [sp, #32]\n\tb\tLBB0_5\nLBB0_4:\n\tmov\tw8, #-1\n\tstur\tw8, [x29, #-4]\n\tb\tLBB0_29\nLBB0_5:\n```", "role": "assistant" } ]
extr_imaadp32.c_ADPCM_GetFormatIndex.c
[ { "content": "You are given an x86 assembly block (<block>) to traspile into armv8_64 assembly.\nYou are also given the context for this block in the form of pre-context (<pre_context>) and post-context (<post_context>).\nThere is also a pre-target-context (<pre_target>) which is the context for the target block. Use the input pre and post context along with the target pre context to transpile the block from x86 to armv8_64.\n\n```x86asm\n; <pre-context>\n\tmovl\t%eax, -24(%rbp)\n\tmovq\tADPCM_Formats(%rip), %rax\n\tmovq\t%rax, -32(%rbp)\n\tjmp\t.LBB0_4\n.LBB0_3:\n\tmovl\t$-1, -4(%rbp)\n\tjmp\t.LBB0_27\n.LBB0_4:\n\n; <block>\n\tmovl\t$0, -20(%rbp)\n.LBB0_5: # =>This Inner Loop Header: Depth=1\n\tmovl\t-20(%rbp), %eax\n\tcmpl\t-24(%rbp), %eax\n\tjge\t.LBB0_12\n# %bb.6: # in Loop: Header=BB0_5 Depth=1\n\tmovq\t-16(%rbp), %rax\n\tmovq\t8(%rax), %rax\n\tmovq\t-32(%rbp), %rcx\n\tmovslq\t-20(%rbp), %rdx\n\timulq\t$24, %rdx, %rdx\n\taddq\t%rdx, %rcx\n\tcmpq\t(%rcx), %rax\n\tjne\t.LBB0_10\n# %bb.7: # in Loop: Header=BB0_5 Depth=1\n\tmovq\t-16(%rbp), %rax\n\n; <post-context>\n\tmovq\t16(%rax), %rax\n\tmovq\t-32(%rbp), %rcx\n\tmovslq\t-20(%rbp), %rdx\n\timulq\t$24, %rdx, %rdx\n\taddq\t%rdx, %rcx\n\tcmpq\t8(%rcx), %rax\n\tjne\t.LBB0_10\n# %bb.8: # in Loop: Header=BB0_5 Depth=1\n\tmovq\t-16(%rbp), %rax\n\n```\n\n```armasm\n; <pre-target>\n\t.cfi_startproc\n; %bb.0:\n\tsub\tsp, sp, #80\n\t.cfi_def_cfa_offset 80\n\tstp\tx29, x30, [sp, #64] ; 16-byte Folded Spill\n\tadd\tx29, sp, #64\n\t.cfi_def_cfa w29, 16\n\t.cfi_offset w30, -8\n\t.cfi_offset w29, -16\n\tstur\tx0, [x29, #-16]\n\tldur\tx8, [x29, #-16]\n\tldr\tw8, [x8]\n\tstr\tw8, [sp, #28] ; 4-byte Folded Spill\n\tsubs\tw8, w8, #128\n\tcset\tw8, eq\n\ttbnz\tw8, #0, LBB0_2\n\tb\tLBB0_1\nLBB0_1:\n\tldr\tw8, [sp, #28] ; 4-byte Folded Reload\n\tsubs\tw8, w8, #129\n\tcset\tw8, eq\n\ttbnz\tw8, #0, LBB0_3\n\tb\tLBB0_4\nLBB0_2:\n\tadrp\tx8, _PCM_Formats@GOTPAGE\n\tldr\tx8, [x8, _PCM_Formats@GOTPAGEOFF]\n\tstr\tx8, [sp, #16] ; 8-byte Folded Spill\n\tldr\tx0, [x8]\n\tbl\t_ARRAY_SIZE\n\tldr\tx8, [sp, #16] ; 8-byte Folded Reload\n\tstur\tw0, [x29, #-24]\n\tldr\tx8, [x8]\n\tstr\tx8, [sp, #32]\n\tb\tLBB0_5\nLBB0_3:\n\tadrp\tx8, _ADPCM_Formats@GOTPAGE\n\tldr\tx8, [x8, _ADPCM_Formats@GOTPAGEOFF]\n\tstr\tx8, [sp, #8] ; 8-byte Folded Spill\n\tldr\tx0, [x8]\n\tbl\t_ARRAY_SIZE\n\tldr\tx8, [sp, #8] ; 8-byte Folded Reload\n\tstur\tw0, [x29, #-24]\n\tldr\tx8, [x8]\n\tstr\tx8, [sp, #32]\n\tb\tLBB0_5\nLBB0_4:\n\tmov\tw8, #-1\n\tstur\tw8, [x29, #-4]\n\tb\tLBB0_29\nLBB0_5:\n\n```", "role": "user" }, { "content": "```armasm\n\tstur\twzr, [x29, #-20]\n\tb\tLBB0_6\nLBB0_6: ; =>This Inner Loop Header: Depth=1\n\tldur\tw8, [x29, #-20]\n\tldur\tw9, [x29, #-24]\n\tsubs\tw8, w8, w9\n\tcset\tw8, ge\n\ttbnz\tw8, #0, LBB0_13\n\tb\tLBB0_7\nLBB0_7: ; in Loop: Header=BB0_6 Depth=1\n\tldur\tx8, [x29, #-16]\n\tldr\tx8, [x8, #8]\n\tldr\tx9, [sp, #32]\n\tldursw\tx10, [x29, #-20]\n\tmov\tx11, #24\n\tmul\tx10, x10, x11\n\tldr\tx9, [x9, x10]\n\tsubs\tx8, x8, x9\n\tcset\tw8, ne\n\ttbnz\tw8, #0, LBB0_11\n\tb\tLBB0_8\nLBB0_8: ; in Loop: Header=BB0_6 Depth=1\n\tldur\tx8, [x29, #-16]\n```", "role": "assistant" } ]
extr_imaadp32.c_ADPCM_GetFormatIndex.c
[ { "content": "You are given an x86 assembly block (<block>) to traspile into armv8_64 assembly.\nYou are also given the context for this block in the form of pre-context (<pre_context>) and post-context (<post_context>).\nThere is also a pre-target-context (<pre_target>) which is the context for the target block. Use the input pre and post context along with the target pre context to transpile the block from x86 to armv8_64.\n\n```x86asm\n; <pre-context>\n\tmovq\t8(%rax), %rax\n\tmovq\t-32(%rbp), %rcx\n\tmovslq\t-20(%rbp), %rdx\n\timulq\t$24, %rdx, %rdx\n\taddq\t%rdx, %rcx\n\tcmpq\t(%rcx), %rax\n\tjne\t.LBB0_10\n# %bb.7: # in Loop: Header=BB0_5 Depth=1\n\tmovq\t-16(%rbp), %rax\n\n; <block>\n\tmovq\t16(%rax), %rax\n\tmovq\t-32(%rbp), %rcx\n\tmovslq\t-20(%rbp), %rdx\n\timulq\t$24, %rdx, %rdx\n\taddq\t%rdx, %rcx\n\tcmpq\t8(%rcx), %rax\n\tjne\t.LBB0_10\n# %bb.8: # in Loop: Header=BB0_5 Depth=1\n\tmovq\t-16(%rbp), %rax\n\tmovq\t24(%rax), %rax\n\tmovq\t-32(%rbp), %rcx\n\tmovslq\t-20(%rbp), %rdx\n\timulq\t$24, %rdx, %rdx\n\taddq\t%rdx, %rcx\n\tcmpq\t16(%rcx), %rax\n\tjne\t.LBB0_10\n# %bb.9:\n\tmovl\t-20(%rbp), %eax\n\n; <post-context>\n\tmovl\t%eax, -4(%rbp)\n\tjmp\t.LBB0_27\n.LBB0_10: # in Loop: Header=BB0_5 Depth=1\n\tjmp\t.LBB0_11\n.LBB0_11: # in Loop: Header=BB0_5 Depth=1\n\tmovl\t-20(%rbp), %eax\n\taddl\t$1, %eax\n\tmovl\t%eax, -20(%rbp)\n\tjmp\t.LBB0_5\n.LBB0_12:\n\tmovq\t-16(%rbp), %rax\n\n```\n\n```armasm\n; <pre-target>\n\t.cfi_startproc\n; %bb.0:\n\tsub\tsp, sp, #80\n\t.cfi_def_cfa_offset 80\n\tstp\tx29, x30, [sp, #64] ; 16-byte Folded Spill\n\tadd\tx29, sp, #64\n\t.cfi_def_cfa w29, 16\n\t.cfi_offset w30, -8\n\t.cfi_offset w29, -16\n\tstur\tx0, [x29, #-16]\n\tldur\tx8, [x29, #-16]\n\tldr\tw8, [x8]\n\tstr\tw8, [sp, #28] ; 4-byte Folded Spill\n\tsubs\tw8, w8, #128\n\tcset\tw8, eq\n\ttbnz\tw8, #0, LBB0_2\n\tb\tLBB0_1\nLBB0_1:\n\tldr\tw8, [sp, #28] ; 4-byte Folded Reload\n\tsubs\tw8, w8, #129\n\tcset\tw8, eq\n\ttbnz\tw8, #0, LBB0_3\n\tb\tLBB0_4\nLBB0_2:\n\tadrp\tx8, _PCM_Formats@GOTPAGE\n\tldr\tx8, [x8, _PCM_Formats@GOTPAGEOFF]\n\tstr\tx8, [sp, #16] ; 8-byte Folded Spill\n\tldr\tx0, [x8]\n\tbl\t_ARRAY_SIZE\n\tldr\tx8, [sp, #16] ; 8-byte Folded Reload\n\tstur\tw0, [x29, #-24]\n\tldr\tx8, [x8]\n\tstr\tx8, [sp, #32]\n\tb\tLBB0_5\nLBB0_3:\n\tadrp\tx8, _ADPCM_Formats@GOTPAGE\n\tldr\tx8, [x8, _ADPCM_Formats@GOTPAGEOFF]\n\tstr\tx8, [sp, #8] ; 8-byte Folded Spill\n\tldr\tx0, [x8]\n\tbl\t_ARRAY_SIZE\n\tldr\tx8, [sp, #8] ; 8-byte Folded Reload\n\tstur\tw0, [x29, #-24]\n\tldr\tx8, [x8]\n\tstr\tx8, [sp, #32]\n\tb\tLBB0_5\nLBB0_4:\n\tmov\tw8, #-1\n\tstur\tw8, [x29, #-4]\n\tb\tLBB0_29\nLBB0_5:\n\tstur\twzr, [x29, #-20]\n\tb\tLBB0_6\nLBB0_6: ; =>This Inner Loop Header: Depth=1\n\tldur\tw8, [x29, #-20]\n\tldur\tw9, [x29, #-24]\n\tsubs\tw8, w8, w9\n\tcset\tw8, ge\n\ttbnz\tw8, #0, LBB0_13\n\tb\tLBB0_7\nLBB0_7: ; in Loop: Header=BB0_6 Depth=1\n\tldur\tx8, [x29, #-16]\n\tldr\tx8, [x8, #8]\n\tldr\tx9, [sp, #32]\n\tldursw\tx10, [x29, #-20]\n\tmov\tx11, #24\n\tmul\tx10, x10, x11\n\tldr\tx9, [x9, x10]\n\tsubs\tx8, x8, x9\n\tcset\tw8, ne\n\ttbnz\tw8, #0, LBB0_11\n\tb\tLBB0_8\nLBB0_8: ; in Loop: Header=BB0_6 Depth=1\n\tldur\tx8, [x29, #-16]\n\n```", "role": "user" }, { "content": "```armasm\n\tldr\tx8, [x8, #16]\n\tldr\tx9, [sp, #32]\n\tldursw\tx10, [x29, #-20]\n\tmov\tx11, #24\n\tmul\tx10, x10, x11\n\tadd\tx9, x9, x10\n\tldr\tx9, [x9, #8]\n\tsubs\tx8, x8, x9\n\tcset\tw8, ne\n\ttbnz\tw8, #0, LBB0_11\n\tb\tLBB0_9\nLBB0_9: ; in Loop: Header=BB0_6 Depth=1\n\tldur\tx8, [x29, #-16]\n\tmov\tx11, #24\n\tldr\tx8, [x8, #24]\n\tldr\tx9, [sp, #32]\n\tldursw\tx10, [x29, #-20]\n\tmul\tx10, x10, x11\n\tadd\tx9, x9, x10\n\tldr\tx9, [x9, #16]\n\tsubs\tx8, x8, x9\n\tcset\tw8, ne\n\ttbnz\tw8, #0, LBB0_11\n\tb\tLBB0_10\nLBB0_10:\n\tldur\tw8, [x29, #-20]\n```", "role": "assistant" } ]
extr_imaadp32.c_ADPCM_GetFormatIndex.c
[ { "content": "You are given an x86 assembly block (<block>) to traspile into armv8_64 assembly.\nYou are also given the context for this block in the form of pre-context (<pre_context>) and post-context (<post_context>).\nThere is also a pre-target-context (<pre_target>) which is the context for the target block. Use the input pre and post context along with the target pre context to transpile the block from x86 to armv8_64.\n\n```x86asm\n; <pre-context>\n\tmovq\t24(%rax), %rax\n\tmovq\t-32(%rbp), %rcx\n\tmovslq\t-20(%rbp), %rdx\n\timulq\t$24, %rdx, %rdx\n\taddq\t%rdx, %rcx\n\tcmpq\t16(%rcx), %rax\n\tjne\t.LBB0_10\n# %bb.9:\n\tmovl\t-20(%rbp), %eax\n\n; <block>\n\tmovl\t%eax, -4(%rbp)\n\tjmp\t.LBB0_27\n.LBB0_10: # in Loop: Header=BB0_5 Depth=1\n\tjmp\t.LBB0_11\n.LBB0_11: # in Loop: Header=BB0_5 Depth=1\n\tmovl\t-20(%rbp), %eax\n\taddl\t$1, %eax\n\tmovl\t%eax, -20(%rbp)\n\tjmp\t.LBB0_5\n.LBB0_12:\n\tmovq\t-16(%rbp), %rax\n\tmovl\t(%rax), %eax\n\tmovl\t%eax, -40(%rbp) # 4-byte Spill\n\tsubl\t$128, %eax\n\tje\t.LBB0_13\n\tjmp\t.LBB0_29\n.LBB0_29:\n\tmovl\t-40(%rbp), %eax # 4-byte Reload\n\tsubl\t$129, %eax\n\tje\t.LBB0_20\n\tjmp\t.LBB0_26\n.LBB0_13:\n\tmovq\t-16(%rbp), %rcx\n\tmovl\t$3, %eax\n\n; <post-context>\n\tcmpq\t8(%rcx), %rax\n\tjle\t.LBB0_19\n# %bb.14:\n\tmovq\t-16(%rbp), %rax\n\tcmpq\t$0, 8(%rax)\n\tjle\t.LBB0_19\n# %bb.15:\n\n```\n\n```armasm\n; <pre-target>\n\t.cfi_startproc\n; %bb.0:\n\tsub\tsp, sp, #80\n\t.cfi_def_cfa_offset 80\n\tstp\tx29, x30, [sp, #64] ; 16-byte Folded Spill\n\tadd\tx29, sp, #64\n\t.cfi_def_cfa w29, 16\n\t.cfi_offset w30, -8\n\t.cfi_offset w29, -16\n\tstur\tx0, [x29, #-16]\n\tldur\tx8, [x29, #-16]\n\tldr\tw8, [x8]\n\tstr\tw8, [sp, #28] ; 4-byte Folded Spill\n\tsubs\tw8, w8, #128\n\tcset\tw8, eq\n\ttbnz\tw8, #0, LBB0_2\n\tb\tLBB0_1\nLBB0_1:\n\tldr\tw8, [sp, #28] ; 4-byte Folded Reload\n\tsubs\tw8, w8, #129\n\tcset\tw8, eq\n\ttbnz\tw8, #0, LBB0_3\n\tb\tLBB0_4\nLBB0_2:\n\tadrp\tx8, _PCM_Formats@GOTPAGE\n\tldr\tx8, [x8, _PCM_Formats@GOTPAGEOFF]\n\tstr\tx8, [sp, #16] ; 8-byte Folded Spill\n\tldr\tx0, [x8]\n\tbl\t_ARRAY_SIZE\n\tldr\tx8, [sp, #16] ; 8-byte Folded Reload\n\tstur\tw0, [x29, #-24]\n\tldr\tx8, [x8]\n\tstr\tx8, [sp, #32]\n\tb\tLBB0_5\nLBB0_3:\n\tadrp\tx8, _ADPCM_Formats@GOTPAGE\n\tldr\tx8, [x8, _ADPCM_Formats@GOTPAGEOFF]\n\tstr\tx8, [sp, #8] ; 8-byte Folded Spill\n\tldr\tx0, [x8]\n\tbl\t_ARRAY_SIZE\n\tldr\tx8, [sp, #8] ; 8-byte Folded Reload\n\tstur\tw0, [x29, #-24]\n\tldr\tx8, [x8]\n\tstr\tx8, [sp, #32]\n\tb\tLBB0_5\nLBB0_4:\n\tmov\tw8, #-1\n\tstur\tw8, [x29, #-4]\n\tb\tLBB0_29\nLBB0_5:\n\tstur\twzr, [x29, #-20]\n\tb\tLBB0_6\nLBB0_6: ; =>This Inner Loop Header: Depth=1\n\tldur\tw8, [x29, #-20]\n\tldur\tw9, [x29, #-24]\n\tsubs\tw8, w8, w9\n\tcset\tw8, ge\n\ttbnz\tw8, #0, LBB0_13\n\tb\tLBB0_7\nLBB0_7: ; in Loop: Header=BB0_6 Depth=1\n\tldur\tx8, [x29, #-16]\n\tldr\tx8, [x8, #8]\n\tldr\tx9, [sp, #32]\n\tldursw\tx10, [x29, #-20]\n\tmov\tx11, #24\n\tmul\tx10, x10, x11\n\tldr\tx9, [x9, x10]\n\tsubs\tx8, x8, x9\n\tcset\tw8, ne\n\ttbnz\tw8, #0, LBB0_11\n\tb\tLBB0_8\nLBB0_8: ; in Loop: Header=BB0_6 Depth=1\n\tldur\tx8, [x29, #-16]\n\tldr\tx8, [x8, #16]\n\tldr\tx9, [sp, #32]\n\tldursw\tx10, [x29, #-20]\n\tmov\tx11, #24\n\tmul\tx10, x10, x11\n\tadd\tx9, x9, x10\n\tldr\tx9, [x9, #8]\n\tsubs\tx8, x8, x9\n\tcset\tw8, ne\n\ttbnz\tw8, #0, LBB0_11\n\tb\tLBB0_9\nLBB0_9: ; in Loop: Header=BB0_6 Depth=1\n\tldur\tx8, [x29, #-16]\n\tmov\tx11, #24\n\tldr\tx8, [x8, #24]\n\tldr\tx9, [sp, #32]\n\tldursw\tx10, [x29, #-20]\n\tmul\tx10, x10, x11\n\tadd\tx9, x9, x10\n\tldr\tx9, [x9, #16]\n\tsubs\tx8, x8, x9\n\tcset\tw8, ne\n\ttbnz\tw8, #0, LBB0_11\n\tb\tLBB0_10\nLBB0_10:\n\tldur\tw8, [x29, #-20]\n\n```", "role": "user" }, { "content": "```armasm\n\tstur\tw8, [x29, #-4]\n\tb\tLBB0_29\nLBB0_11: ; in Loop: Header=BB0_6 Depth=1\n\tb\tLBB0_12\nLBB0_12: ; in Loop: Header=BB0_6 Depth=1\n\tldur\tw8, [x29, #-20]\n\tadd\tw8, w8, #1\n\tstur\tw8, [x29, #-20]\n\tb\tLBB0_6\nLBB0_13:\n\tldur\tx8, [x29, #-16]\n\tldr\tw8, [x8]\n\tstr\tw8, [sp, #4] ; 4-byte Folded Spill\n\tsubs\tw8, w8, #128\n\tcset\tw8, eq\n\ttbnz\tw8, #0, LBB0_15\n\tb\tLBB0_14\nLBB0_14:\n\tldr\tw8, [sp, #4] ; 4-byte Folded Reload\n\tsubs\tw8, w8, #129\n\tcset\tw8, eq\n\ttbnz\tw8, #0, LBB0_22\n\tb\tLBB0_28\nLBB0_15:\n\tldur\tx8, [x29, #-16]\n\tldr\tx9, [x8, #8]\n\tmov\tx8, #3\n```", "role": "assistant" } ]
extr_imaadp32.c_ADPCM_GetFormatIndex.c
[ { "content": "You are given an x86 assembly block (<block>) to traspile into armv8_64 assembly.\nYou are also given the context for this block in the form of pre-context (<pre_context>) and post-context (<post_context>).\nThere is also a pre-target-context (<pre_target>) which is the context for the target block. Use the input pre and post context along with the target pre context to transpile the block from x86 to armv8_64.\n\n```x86asm\n; <pre-context>\n\tmovl\t(%rax), %eax\n\tmovl\t%eax, -40(%rbp) # 4-byte Spill\n\tsubl\t$128, %eax\n\tje\t.LBB0_13\n\tjmp\t.LBB0_29\n.LBB0_29:\n\tmovl\t-40(%rbp), %eax # 4-byte Reload\n\tsubl\t$129, %eax\n\tje\t.LBB0_20\n\tjmp\t.LBB0_26\n.LBB0_13:\n\tmovq\t-16(%rbp), %rcx\n\tmovl\t$3, %eax\n\n; <block>\n\tcmpq\t8(%rcx), %rax\n\tjle\t.LBB0_19\n# %bb.14:\n\tmovq\t-16(%rbp), %rax\n\tcmpq\t$0, 8(%rax)\n\tjle\t.LBB0_19\n# %bb.15:\n\tmovq\t-16(%rbp), %rax\n\tmovslq\t32(%rax), %rax\n\tmovq\t-16(%rbp), %rcx\n\tmovq\t16(%rcx), %rcx\n\tshlq\t%rcx\n\tmovq\t-16(%rbp), %rdx\n\n; <post-context>\n\timulq\t8(%rdx), %rcx\n\tcmpq\t%rcx, %rax\n\tjne\t.LBB0_19\n# %bb.16:\n\tmovq\t-16(%rbp), %rax\n\tmovslq\t36(%rax), %rax\n\tmovq\t-16(%rbp), %rcx\n\n```\n\n```armasm\n; <pre-target>\n\t.cfi_startproc\n; %bb.0:\n\tsub\tsp, sp, #80\n\t.cfi_def_cfa_offset 80\n\tstp\tx29, x30, [sp, #64] ; 16-byte Folded Spill\n\tadd\tx29, sp, #64\n\t.cfi_def_cfa w29, 16\n\t.cfi_offset w30, -8\n\t.cfi_offset w29, -16\n\tstur\tx0, [x29, #-16]\n\tldur\tx8, [x29, #-16]\n\tldr\tw8, [x8]\n\tstr\tw8, [sp, #28] ; 4-byte Folded Spill\n\tsubs\tw8, w8, #128\n\tcset\tw8, eq\n\ttbnz\tw8, #0, LBB0_2\n\tb\tLBB0_1\nLBB0_1:\n\tldr\tw8, [sp, #28] ; 4-byte Folded Reload\n\tsubs\tw8, w8, #129\n\tcset\tw8, eq\n\ttbnz\tw8, #0, LBB0_3\n\tb\tLBB0_4\nLBB0_2:\n\tadrp\tx8, _PCM_Formats@GOTPAGE\n\tldr\tx8, [x8, _PCM_Formats@GOTPAGEOFF]\n\tstr\tx8, [sp, #16] ; 8-byte Folded Spill\n\tldr\tx0, [x8]\n\tbl\t_ARRAY_SIZE\n\tldr\tx8, [sp, #16] ; 8-byte Folded Reload\n\tstur\tw0, [x29, #-24]\n\tldr\tx8, [x8]\n\tstr\tx8, [sp, #32]\n\tb\tLBB0_5\nLBB0_3:\n\tadrp\tx8, _ADPCM_Formats@GOTPAGE\n\tldr\tx8, [x8, _ADPCM_Formats@GOTPAGEOFF]\n\tstr\tx8, [sp, #8] ; 8-byte Folded Spill\n\tldr\tx0, [x8]\n\tbl\t_ARRAY_SIZE\n\tldr\tx8, [sp, #8] ; 8-byte Folded Reload\n\tstur\tw0, [x29, #-24]\n\tldr\tx8, [x8]\n\tstr\tx8, [sp, #32]\n\tb\tLBB0_5\nLBB0_4:\n\tmov\tw8, #-1\n\tstur\tw8, [x29, #-4]\n\tb\tLBB0_29\nLBB0_5:\n\tstur\twzr, [x29, #-20]\n\tb\tLBB0_6\nLBB0_6: ; =>This Inner Loop Header: Depth=1\n\tldur\tw8, [x29, #-20]\n\tldur\tw9, [x29, #-24]\n\tsubs\tw8, w8, w9\n\tcset\tw8, ge\n\ttbnz\tw8, #0, LBB0_13\n\tb\tLBB0_7\nLBB0_7: ; in Loop: Header=BB0_6 Depth=1\n\tldur\tx8, [x29, #-16]\n\tldr\tx8, [x8, #8]\n\tldr\tx9, [sp, #32]\n\tldursw\tx10, [x29, #-20]\n\tmov\tx11, #24\n\tmul\tx10, x10, x11\n\tldr\tx9, [x9, x10]\n\tsubs\tx8, x8, x9\n\tcset\tw8, ne\n\ttbnz\tw8, #0, LBB0_11\n\tb\tLBB0_8\nLBB0_8: ; in Loop: Header=BB0_6 Depth=1\n\tldur\tx8, [x29, #-16]\n\tldr\tx8, [x8, #16]\n\tldr\tx9, [sp, #32]\n\tldursw\tx10, [x29, #-20]\n\tmov\tx11, #24\n\tmul\tx10, x10, x11\n\tadd\tx9, x9, x10\n\tldr\tx9, [x9, #8]\n\tsubs\tx8, x8, x9\n\tcset\tw8, ne\n\ttbnz\tw8, #0, LBB0_11\n\tb\tLBB0_9\nLBB0_9: ; in Loop: Header=BB0_6 Depth=1\n\tldur\tx8, [x29, #-16]\n\tmov\tx11, #24\n\tldr\tx8, [x8, #24]\n\tldr\tx9, [sp, #32]\n\tldursw\tx10, [x29, #-20]\n\tmul\tx10, x10, x11\n\tadd\tx9, x9, x10\n\tldr\tx9, [x9, #16]\n\tsubs\tx8, x8, x9\n\tcset\tw8, ne\n\ttbnz\tw8, #0, LBB0_11\n\tb\tLBB0_10\nLBB0_10:\n\tldur\tw8, [x29, #-20]\n\tstur\tw8, [x29, #-4]\n\tb\tLBB0_29\nLBB0_11: ; in Loop: Header=BB0_6 Depth=1\n\tb\tLBB0_12\nLBB0_12: ; in Loop: Header=BB0_6 Depth=1\n\tldur\tw8, [x29, #-20]\n\tadd\tw8, w8, #1\n\tstur\tw8, [x29, #-20]\n\tb\tLBB0_6\nLBB0_13:\n\tldur\tx8, [x29, #-16]\n\tldr\tw8, [x8]\n\tstr\tw8, [sp, #4] ; 4-byte Folded Spill\n\tsubs\tw8, w8, #128\n\tcset\tw8, eq\n\ttbnz\tw8, #0, LBB0_15\n\tb\tLBB0_14\nLBB0_14:\n\tldr\tw8, [sp, #4] ; 4-byte Folded Reload\n\tsubs\tw8, w8, #129\n\tcset\tw8, eq\n\ttbnz\tw8, #0, LBB0_22\n\tb\tLBB0_28\nLBB0_15:\n\tldur\tx8, [x29, #-16]\n\tldr\tx9, [x8, #8]\n\tmov\tx8, #3\n\n```", "role": "user" }, { "content": "```armasm\n\tsubs\tx8, x8, x9\n\tcset\tw8, le\n\ttbnz\tw8, #0, LBB0_21\n\tb\tLBB0_16\nLBB0_16:\n\tldur\tx8, [x29, #-16]\n\tldr\tx8, [x8, #8]\n\tsubs\tx8, x8, #0\n\tcset\tw8, le\n\ttbnz\tw8, #0, LBB0_21\n\tb\tLBB0_17\nLBB0_17:\n\tldur\tx8, [x29, #-16]\n\tldrsw\tx8, [x8, #32]\n\tldur\tx9, [x29, #-16]\n\tldr\tx10, [x9, #16]\n\tmov\tx9, #2\n\tmul\tx9, x9, x10\n\tldur\tx10, [x29, #-16]\n\tldr\tx10, [x10, #8]\n```", "role": "assistant" } ]
extr_imaadp32.c_ADPCM_GetFormatIndex.c
[ { "content": "You are given an x86 assembly block (<block>) to traspile into armv8_64 assembly.\nYou are also given the context for this block in the form of pre-context (<pre_context>) and post-context (<post_context>).\nThere is also a pre-target-context (<pre_target>) which is the context for the target block. Use the input pre and post context along with the target pre context to transpile the block from x86 to armv8_64.\n\n```x86asm\n; <pre-context>\n\tmovq\t-16(%rbp), %rax\n\tmovslq\t32(%rax), %rax\n\tmovq\t-16(%rbp), %rcx\n\tmovq\t16(%rcx), %rcx\n\tshlq\t%rcx\n\tmovq\t-16(%rbp), %rdx\n\n; <block>\n\timulq\t8(%rdx), %rcx\n\tcmpq\t%rcx, %rax\n\tjne\t.LBB0_19\n# %bb.16:\n\tmovq\t-16(%rbp), %rax\n\tmovslq\t36(%rax), %rax\n\tmovq\t-16(%rbp), %rcx\n\tmovq\t8(%rcx), %rcx\n\tshlq\t%rcx\n\tcmpq\t%rcx, %rax\n\tjne\t.LBB0_19\n# %bb.17:\n\tmovq\t-16(%rbp), %rax\n\n; <post-context>\n\tcmpq\t$16, 24(%rax)\n\tjne\t.LBB0_19\n# %bb.18:\n\tmovl\t-24(%rbp), %eax\n\tmovl\t%eax, -4(%rbp)\n\tjmp\t.LBB0_27\n.LBB0_19:\n\tjmp\t.LBB0_26\n.LBB0_20:\n\n```\n\n```armasm\n; <pre-target>\n\t.cfi_startproc\n; %bb.0:\n\tsub\tsp, sp, #80\n\t.cfi_def_cfa_offset 80\n\tstp\tx29, x30, [sp, #64] ; 16-byte Folded Spill\n\tadd\tx29, sp, #64\n\t.cfi_def_cfa w29, 16\n\t.cfi_offset w30, -8\n\t.cfi_offset w29, -16\n\tstur\tx0, [x29, #-16]\n\tldur\tx8, [x29, #-16]\n\tldr\tw8, [x8]\n\tstr\tw8, [sp, #28] ; 4-byte Folded Spill\n\tsubs\tw8, w8, #128\n\tcset\tw8, eq\n\ttbnz\tw8, #0, LBB0_2\n\tb\tLBB0_1\nLBB0_1:\n\tldr\tw8, [sp, #28] ; 4-byte Folded Reload\n\tsubs\tw8, w8, #129\n\tcset\tw8, eq\n\ttbnz\tw8, #0, LBB0_3\n\tb\tLBB0_4\nLBB0_2:\n\tadrp\tx8, _PCM_Formats@GOTPAGE\n\tldr\tx8, [x8, _PCM_Formats@GOTPAGEOFF]\n\tstr\tx8, [sp, #16] ; 8-byte Folded Spill\n\tldr\tx0, [x8]\n\tbl\t_ARRAY_SIZE\n\tldr\tx8, [sp, #16] ; 8-byte Folded Reload\n\tstur\tw0, [x29, #-24]\n\tldr\tx8, [x8]\n\tstr\tx8, [sp, #32]\n\tb\tLBB0_5\nLBB0_3:\n\tadrp\tx8, _ADPCM_Formats@GOTPAGE\n\tldr\tx8, [x8, _ADPCM_Formats@GOTPAGEOFF]\n\tstr\tx8, [sp, #8] ; 8-byte Folded Spill\n\tldr\tx0, [x8]\n\tbl\t_ARRAY_SIZE\n\tldr\tx8, [sp, #8] ; 8-byte Folded Reload\n\tstur\tw0, [x29, #-24]\n\tldr\tx8, [x8]\n\tstr\tx8, [sp, #32]\n\tb\tLBB0_5\nLBB0_4:\n\tmov\tw8, #-1\n\tstur\tw8, [x29, #-4]\n\tb\tLBB0_29\nLBB0_5:\n\tstur\twzr, [x29, #-20]\n\tb\tLBB0_6\nLBB0_6: ; =>This Inner Loop Header: Depth=1\n\tldur\tw8, [x29, #-20]\n\tldur\tw9, [x29, #-24]\n\tsubs\tw8, w8, w9\n\tcset\tw8, ge\n\ttbnz\tw8, #0, LBB0_13\n\tb\tLBB0_7\nLBB0_7: ; in Loop: Header=BB0_6 Depth=1\n\tldur\tx8, [x29, #-16]\n\tldr\tx8, [x8, #8]\n\tldr\tx9, [sp, #32]\n\tldursw\tx10, [x29, #-20]\n\tmov\tx11, #24\n\tmul\tx10, x10, x11\n\tldr\tx9, [x9, x10]\n\tsubs\tx8, x8, x9\n\tcset\tw8, ne\n\ttbnz\tw8, #0, LBB0_11\n\tb\tLBB0_8\nLBB0_8: ; in Loop: Header=BB0_6 Depth=1\n\tldur\tx8, [x29, #-16]\n\tldr\tx8, [x8, #16]\n\tldr\tx9, [sp, #32]\n\tldursw\tx10, [x29, #-20]\n\tmov\tx11, #24\n\tmul\tx10, x10, x11\n\tadd\tx9, x9, x10\n\tldr\tx9, [x9, #8]\n\tsubs\tx8, x8, x9\n\tcset\tw8, ne\n\ttbnz\tw8, #0, LBB0_11\n\tb\tLBB0_9\nLBB0_9: ; in Loop: Header=BB0_6 Depth=1\n\tldur\tx8, [x29, #-16]\n\tmov\tx11, #24\n\tldr\tx8, [x8, #24]\n\tldr\tx9, [sp, #32]\n\tldursw\tx10, [x29, #-20]\n\tmul\tx10, x10, x11\n\tadd\tx9, x9, x10\n\tldr\tx9, [x9, #16]\n\tsubs\tx8, x8, x9\n\tcset\tw8, ne\n\ttbnz\tw8, #0, LBB0_11\n\tb\tLBB0_10\nLBB0_10:\n\tldur\tw8, [x29, #-20]\n\tstur\tw8, [x29, #-4]\n\tb\tLBB0_29\nLBB0_11: ; in Loop: Header=BB0_6 Depth=1\n\tb\tLBB0_12\nLBB0_12: ; in Loop: Header=BB0_6 Depth=1\n\tldur\tw8, [x29, #-20]\n\tadd\tw8, w8, #1\n\tstur\tw8, [x29, #-20]\n\tb\tLBB0_6\nLBB0_13:\n\tldur\tx8, [x29, #-16]\n\tldr\tw8, [x8]\n\tstr\tw8, [sp, #4] ; 4-byte Folded Spill\n\tsubs\tw8, w8, #128\n\tcset\tw8, eq\n\ttbnz\tw8, #0, LBB0_15\n\tb\tLBB0_14\nLBB0_14:\n\tldr\tw8, [sp, #4] ; 4-byte Folded Reload\n\tsubs\tw8, w8, #129\n\tcset\tw8, eq\n\ttbnz\tw8, #0, LBB0_22\n\tb\tLBB0_28\nLBB0_15:\n\tldur\tx8, [x29, #-16]\n\tldr\tx9, [x8, #8]\n\tmov\tx8, #3\n\tsubs\tx8, x8, x9\n\tcset\tw8, le\n\ttbnz\tw8, #0, LBB0_21\n\tb\tLBB0_16\nLBB0_16:\n\tldur\tx8, [x29, #-16]\n\tldr\tx8, [x8, #8]\n\tsubs\tx8, x8, #0\n\tcset\tw8, le\n\ttbnz\tw8, #0, LBB0_21\n\tb\tLBB0_17\nLBB0_17:\n\tldur\tx8, [x29, #-16]\n\tldrsw\tx8, [x8, #32]\n\tldur\tx9, [x29, #-16]\n\tldr\tx10, [x9, #16]\n\tmov\tx9, #2\n\tmul\tx9, x9, x10\n\tldur\tx10, [x29, #-16]\n\tldr\tx10, [x10, #8]\n\n```", "role": "user" }, { "content": "```armasm\n\tmul\tx9, x9, x10\n\tsubs\tx8, x8, x9\n\tcset\tw8, ne\n\ttbnz\tw8, #0, LBB0_21\n\tb\tLBB0_18\nLBB0_18:\n\tldur\tx8, [x29, #-16]\n\tldrsw\tx8, [x8, #36]\n\tldur\tx9, [x29, #-16]\n\tldr\tx10, [x9, #8]\n\tmov\tx9, #2\n\tmul\tx9, x9, x10\n\tsubs\tx8, x8, x9\n\tcset\tw8, ne\n\ttbnz\tw8, #0, LBB0_21\n\tb\tLBB0_19\nLBB0_19:\n\tldur\tx8, [x29, #-16]\n\tldr\tx8, [x8, #24]\n```", "role": "assistant" } ]
extr_imaadp32.c_ADPCM_GetFormatIndex.c
[ { "content": "You are given an x86 assembly block (<block>) to traspile into armv8_64 assembly.\nYou are also given the context for this block in the form of pre-context (<pre_context>) and post-context (<post_context>).\nThere is also a pre-target-context (<pre_target>) which is the context for the target block. Use the input pre and post context along with the target pre context to transpile the block from x86 to armv8_64.\n\n```x86asm\n; <pre-context>\n\tmovq\t8(%rcx), %rcx\n\tshlq\t%rcx\n\tcmpq\t%rcx, %rax\n\tjne\t.LBB0_19\n# %bb.17:\n\tmovq\t-16(%rbp), %rax\n\n; <block>\n\tcmpq\t$16, 24(%rax)\n\tjne\t.LBB0_19\n# %bb.18:\n\tmovl\t-24(%rbp), %eax\n\tmovl\t%eax, -4(%rbp)\n\tjmp\t.LBB0_27\n.LBB0_19:\n\tjmp\t.LBB0_26\n.LBB0_20:\n\tmovq\t-16(%rbp), %rcx\n\tmovl\t$3, %eax\n\tcmpq\t8(%rcx), %rax\n\tjle\t.LBB0_25\n# %bb.21:\n\tmovq\t-16(%rbp), %rax\n\tcmpq\t$0, 8(%rax)\n\n; <post-context>\n\tjle\t.LBB0_25\n# %bb.22:\n\tmovq\t-16(%rbp), %rax\n\tcmpq\t$4, 24(%rax)\n\tjne\t.LBB0_25\n# %bb.23:\n\tmovq\t-16(%rbp), %rax\n\n```\n\n```armasm\n; <pre-target>\n\t.cfi_startproc\n; %bb.0:\n\tsub\tsp, sp, #80\n\t.cfi_def_cfa_offset 80\n\tstp\tx29, x30, [sp, #64] ; 16-byte Folded Spill\n\tadd\tx29, sp, #64\n\t.cfi_def_cfa w29, 16\n\t.cfi_offset w30, -8\n\t.cfi_offset w29, -16\n\tstur\tx0, [x29, #-16]\n\tldur\tx8, [x29, #-16]\n\tldr\tw8, [x8]\n\tstr\tw8, [sp, #28] ; 4-byte Folded Spill\n\tsubs\tw8, w8, #128\n\tcset\tw8, eq\n\ttbnz\tw8, #0, LBB0_2\n\tb\tLBB0_1\nLBB0_1:\n\tldr\tw8, [sp, #28] ; 4-byte Folded Reload\n\tsubs\tw8, w8, #129\n\tcset\tw8, eq\n\ttbnz\tw8, #0, LBB0_3\n\tb\tLBB0_4\nLBB0_2:\n\tadrp\tx8, _PCM_Formats@GOTPAGE\n\tldr\tx8, [x8, _PCM_Formats@GOTPAGEOFF]\n\tstr\tx8, [sp, #16] ; 8-byte Folded Spill\n\tldr\tx0, [x8]\n\tbl\t_ARRAY_SIZE\n\tldr\tx8, [sp, #16] ; 8-byte Folded Reload\n\tstur\tw0, [x29, #-24]\n\tldr\tx8, [x8]\n\tstr\tx8, [sp, #32]\n\tb\tLBB0_5\nLBB0_3:\n\tadrp\tx8, _ADPCM_Formats@GOTPAGE\n\tldr\tx8, [x8, _ADPCM_Formats@GOTPAGEOFF]\n\tstr\tx8, [sp, #8] ; 8-byte Folded Spill\n\tldr\tx0, [x8]\n\tbl\t_ARRAY_SIZE\n\tldr\tx8, [sp, #8] ; 8-byte Folded Reload\n\tstur\tw0, [x29, #-24]\n\tldr\tx8, [x8]\n\tstr\tx8, [sp, #32]\n\tb\tLBB0_5\nLBB0_4:\n\tmov\tw8, #-1\n\tstur\tw8, [x29, #-4]\n\tb\tLBB0_29\nLBB0_5:\n\tstur\twzr, [x29, #-20]\n\tb\tLBB0_6\nLBB0_6: ; =>This Inner Loop Header: Depth=1\n\tldur\tw8, [x29, #-20]\n\tldur\tw9, [x29, #-24]\n\tsubs\tw8, w8, w9\n\tcset\tw8, ge\n\ttbnz\tw8, #0, LBB0_13\n\tb\tLBB0_7\nLBB0_7: ; in Loop: Header=BB0_6 Depth=1\n\tldur\tx8, [x29, #-16]\n\tldr\tx8, [x8, #8]\n\tldr\tx9, [sp, #32]\n\tldursw\tx10, [x29, #-20]\n\tmov\tx11, #24\n\tmul\tx10, x10, x11\n\tldr\tx9, [x9, x10]\n\tsubs\tx8, x8, x9\n\tcset\tw8, ne\n\ttbnz\tw8, #0, LBB0_11\n\tb\tLBB0_8\nLBB0_8: ; in Loop: Header=BB0_6 Depth=1\n\tldur\tx8, [x29, #-16]\n\tldr\tx8, [x8, #16]\n\tldr\tx9, [sp, #32]\n\tldursw\tx10, [x29, #-20]\n\tmov\tx11, #24\n\tmul\tx10, x10, x11\n\tadd\tx9, x9, x10\n\tldr\tx9, [x9, #8]\n\tsubs\tx8, x8, x9\n\tcset\tw8, ne\n\ttbnz\tw8, #0, LBB0_11\n\tb\tLBB0_9\nLBB0_9: ; in Loop: Header=BB0_6 Depth=1\n\tldur\tx8, [x29, #-16]\n\tmov\tx11, #24\n\tldr\tx8, [x8, #24]\n\tldr\tx9, [sp, #32]\n\tldursw\tx10, [x29, #-20]\n\tmul\tx10, x10, x11\n\tadd\tx9, x9, x10\n\tldr\tx9, [x9, #16]\n\tsubs\tx8, x8, x9\n\tcset\tw8, ne\n\ttbnz\tw8, #0, LBB0_11\n\tb\tLBB0_10\nLBB0_10:\n\tldur\tw8, [x29, #-20]\n\tstur\tw8, [x29, #-4]\n\tb\tLBB0_29\nLBB0_11: ; in Loop: Header=BB0_6 Depth=1\n\tb\tLBB0_12\nLBB0_12: ; in Loop: Header=BB0_6 Depth=1\n\tldur\tw8, [x29, #-20]\n\tadd\tw8, w8, #1\n\tstur\tw8, [x29, #-20]\n\tb\tLBB0_6\nLBB0_13:\n\tldur\tx8, [x29, #-16]\n\tldr\tw8, [x8]\n\tstr\tw8, [sp, #4] ; 4-byte Folded Spill\n\tsubs\tw8, w8, #128\n\tcset\tw8, eq\n\ttbnz\tw8, #0, LBB0_15\n\tb\tLBB0_14\nLBB0_14:\n\tldr\tw8, [sp, #4] ; 4-byte Folded Reload\n\tsubs\tw8, w8, #129\n\tcset\tw8, eq\n\ttbnz\tw8, #0, LBB0_22\n\tb\tLBB0_28\nLBB0_15:\n\tldur\tx8, [x29, #-16]\n\tldr\tx9, [x8, #8]\n\tmov\tx8, #3\n\tsubs\tx8, x8, x9\n\tcset\tw8, le\n\ttbnz\tw8, #0, LBB0_21\n\tb\tLBB0_16\nLBB0_16:\n\tldur\tx8, [x29, #-16]\n\tldr\tx8, [x8, #8]\n\tsubs\tx8, x8, #0\n\tcset\tw8, le\n\ttbnz\tw8, #0, LBB0_21\n\tb\tLBB0_17\nLBB0_17:\n\tldur\tx8, [x29, #-16]\n\tldrsw\tx8, [x8, #32]\n\tldur\tx9, [x29, #-16]\n\tldr\tx10, [x9, #16]\n\tmov\tx9, #2\n\tmul\tx9, x9, x10\n\tldur\tx10, [x29, #-16]\n\tldr\tx10, [x10, #8]\n\tmul\tx9, x9, x10\n\tsubs\tx8, x8, x9\n\tcset\tw8, ne\n\ttbnz\tw8, #0, LBB0_21\n\tb\tLBB0_18\nLBB0_18:\n\tldur\tx8, [x29, #-16]\n\tldrsw\tx8, [x8, #36]\n\tldur\tx9, [x29, #-16]\n\tldr\tx10, [x9, #8]\n\tmov\tx9, #2\n\tmul\tx9, x9, x10\n\tsubs\tx8, x8, x9\n\tcset\tw8, ne\n\ttbnz\tw8, #0, LBB0_21\n\tb\tLBB0_19\nLBB0_19:\n\tldur\tx8, [x29, #-16]\n\tldr\tx8, [x8, #24]\n\n```", "role": "user" }, { "content": "```armasm\n\tsubs\tx8, x8, #16\n\tcset\tw8, ne\n\ttbnz\tw8, #0, LBB0_21\n\tb\tLBB0_20\nLBB0_20:\n\tldur\tw8, [x29, #-24]\n\tstur\tw8, [x29, #-4]\n\tb\tLBB0_29\nLBB0_21:\n\tb\tLBB0_28\nLBB0_22:\n\tldur\tx8, [x29, #-16]\n\tldr\tx9, [x8, #8]\n\tmov\tx8, #3\n\tsubs\tx8, x8, x9\n\tcset\tw8, le\n\ttbnz\tw8, #0, LBB0_27\n\tb\tLBB0_23\nLBB0_23:\n\tldur\tx8, [x29, #-16]\n\tldr\tx8, [x8, #8]\n\tsubs\tx8, x8, #0\n\tcset\tw8, le\n```", "role": "assistant" } ]
extr_imaadp32.c_ADPCM_GetFormatIndex.c
[ { "content": "You are given an x86 assembly block (<block>) to traspile into armv8_64 assembly.\nYou are also given the context for this block in the form of pre-context (<pre_context>) and post-context (<post_context>).\nThere is also a pre-target-context (<pre_target>) which is the context for the target block. Use the input pre and post context along with the target pre context to transpile the block from x86 to armv8_64.\n\n```x86asm\n; <pre-context>\n\tmovq\t-16(%rbp), %rcx\n\tmovl\t$3, %eax\n\tcmpq\t8(%rcx), %rax\n\tjle\t.LBB0_25\n# %bb.21:\n\tmovq\t-16(%rbp), %rax\n\tcmpq\t$0, 8(%rax)\n\n; <block>\n\tjle\t.LBB0_25\n# %bb.22:\n\tmovq\t-16(%rbp), %rax\n\tcmpq\t$4, 24(%rax)\n\tjne\t.LBB0_25\n# %bb.23:\n\tmovq\t-16(%rbp), %rax\n\tcmpl\t$2, 40(%rax)\n\tjne\t.LBB0_25\n# %bb.24:\n\tmovl\t-24(%rbp), %eax\n\tmovl\t%eax, -4(%rbp)\n\tjmp\t.LBB0_27\n.LBB0_25:\n\tjmp\t.LBB0_26\n.LBB0_26:\n\n; <post-context>\n\tmovl\t$-1, -4(%rbp)\n.LBB0_27:\n\tmovl\t-4(%rbp), %eax\n\taddq\t$48, %rsp\n\tpopq\t%rbp\n\t.cfi_def_cfa %rsp, 8\n\tretq\n.Lfunc_end0:\n\t.size\tADPCM_GetFormatIndex, .Lfunc_end0-ADPCM_GetFormatIndex\n\t.cfi_endproc\n # -- End function\n\t.type\tPCM_Formats,@object # @PCM_Formats\n\t.bss\n\t.globl\tPCM_Formats\n\t.p2align\t3, 0x0\nPCM_Formats:\n\t.quad\t0\n\t.size\tPCM_Formats, 8\n\n\t.type\tADPCM_Formats,@object # @ADPCM_Formats\n\t.globl\tADPCM_Formats\n\t.p2align\t3, 0x0\nADPCM_Formats:\n\t.quad\t0\n\t.size\tADPCM_Formats, 8\n\n\t.ident\t\"Ubuntu clang version 18.1.3 (1ubuntu1)\"\n\t.section\t\".note.GNU-stack\",\"\",@progbits\n\t.addrsig\n\t.addrsig_sym ADPCM_GetFormatIndex\n\t.addrsig_sym ARRAY_SIZE\n\t.addrsig_sym PCM_Formats\n\t.addrsig_sym ADPCM_Formats\n\n```\n\n```armasm\n; <pre-target>\n\t.cfi_startproc\n; %bb.0:\n\tsub\tsp, sp, #80\n\t.cfi_def_cfa_offset 80\n\tstp\tx29, x30, [sp, #64] ; 16-byte Folded Spill\n\tadd\tx29, sp, #64\n\t.cfi_def_cfa w29, 16\n\t.cfi_offset w30, -8\n\t.cfi_offset w29, -16\n\tstur\tx0, [x29, #-16]\n\tldur\tx8, [x29, #-16]\n\tldr\tw8, [x8]\n\tstr\tw8, [sp, #28] ; 4-byte Folded Spill\n\tsubs\tw8, w8, #128\n\tcset\tw8, eq\n\ttbnz\tw8, #0, LBB0_2\n\tb\tLBB0_1\nLBB0_1:\n\tldr\tw8, [sp, #28] ; 4-byte Folded Reload\n\tsubs\tw8, w8, #129\n\tcset\tw8, eq\n\ttbnz\tw8, #0, LBB0_3\n\tb\tLBB0_4\nLBB0_2:\n\tadrp\tx8, _PCM_Formats@GOTPAGE\n\tldr\tx8, [x8, _PCM_Formats@GOTPAGEOFF]\n\tstr\tx8, [sp, #16] ; 8-byte Folded Spill\n\tldr\tx0, [x8]\n\tbl\t_ARRAY_SIZE\n\tldr\tx8, [sp, #16] ; 8-byte Folded Reload\n\tstur\tw0, [x29, #-24]\n\tldr\tx8, [x8]\n\tstr\tx8, [sp, #32]\n\tb\tLBB0_5\nLBB0_3:\n\tadrp\tx8, _ADPCM_Formats@GOTPAGE\n\tldr\tx8, [x8, _ADPCM_Formats@GOTPAGEOFF]\n\tstr\tx8, [sp, #8] ; 8-byte Folded Spill\n\tldr\tx0, [x8]\n\tbl\t_ARRAY_SIZE\n\tldr\tx8, [sp, #8] ; 8-byte Folded Reload\n\tstur\tw0, [x29, #-24]\n\tldr\tx8, [x8]\n\tstr\tx8, [sp, #32]\n\tb\tLBB0_5\nLBB0_4:\n\tmov\tw8, #-1\n\tstur\tw8, [x29, #-4]\n\tb\tLBB0_29\nLBB0_5:\n\tstur\twzr, [x29, #-20]\n\tb\tLBB0_6\nLBB0_6: ; =>This Inner Loop Header: Depth=1\n\tldur\tw8, [x29, #-20]\n\tldur\tw9, [x29, #-24]\n\tsubs\tw8, w8, w9\n\tcset\tw8, ge\n\ttbnz\tw8, #0, LBB0_13\n\tb\tLBB0_7\nLBB0_7: ; in Loop: Header=BB0_6 Depth=1\n\tldur\tx8, [x29, #-16]\n\tldr\tx8, [x8, #8]\n\tldr\tx9, [sp, #32]\n\tldursw\tx10, [x29, #-20]\n\tmov\tx11, #24\n\tmul\tx10, x10, x11\n\tldr\tx9, [x9, x10]\n\tsubs\tx8, x8, x9\n\tcset\tw8, ne\n\ttbnz\tw8, #0, LBB0_11\n\tb\tLBB0_8\nLBB0_8: ; in Loop: Header=BB0_6 Depth=1\n\tldur\tx8, [x29, #-16]\n\tldr\tx8, [x8, #16]\n\tldr\tx9, [sp, #32]\n\tldursw\tx10, [x29, #-20]\n\tmov\tx11, #24\n\tmul\tx10, x10, x11\n\tadd\tx9, x9, x10\n\tldr\tx9, [x9, #8]\n\tsubs\tx8, x8, x9\n\tcset\tw8, ne\n\ttbnz\tw8, #0, LBB0_11\n\tb\tLBB0_9\nLBB0_9: ; in Loop: Header=BB0_6 Depth=1\n\tldur\tx8, [x29, #-16]\n\tmov\tx11, #24\n\tldr\tx8, [x8, #24]\n\tldr\tx9, [sp, #32]\n\tldursw\tx10, [x29, #-20]\n\tmul\tx10, x10, x11\n\tadd\tx9, x9, x10\n\tldr\tx9, [x9, #16]\n\tsubs\tx8, x8, x9\n\tcset\tw8, ne\n\ttbnz\tw8, #0, LBB0_11\n\tb\tLBB0_10\nLBB0_10:\n\tldur\tw8, [x29, #-20]\n\tstur\tw8, [x29, #-4]\n\tb\tLBB0_29\nLBB0_11: ; in Loop: Header=BB0_6 Depth=1\n\tb\tLBB0_12\nLBB0_12: ; in Loop: Header=BB0_6 Depth=1\n\tldur\tw8, [x29, #-20]\n\tadd\tw8, w8, #1\n\tstur\tw8, [x29, #-20]\n\tb\tLBB0_6\nLBB0_13:\n\tldur\tx8, [x29, #-16]\n\tldr\tw8, [x8]\n\tstr\tw8, [sp, #4] ; 4-byte Folded Spill\n\tsubs\tw8, w8, #128\n\tcset\tw8, eq\n\ttbnz\tw8, #0, LBB0_15\n\tb\tLBB0_14\nLBB0_14:\n\tldr\tw8, [sp, #4] ; 4-byte Folded Reload\n\tsubs\tw8, w8, #129\n\tcset\tw8, eq\n\ttbnz\tw8, #0, LBB0_22\n\tb\tLBB0_28\nLBB0_15:\n\tldur\tx8, [x29, #-16]\n\tldr\tx9, [x8, #8]\n\tmov\tx8, #3\n\tsubs\tx8, x8, x9\n\tcset\tw8, le\n\ttbnz\tw8, #0, LBB0_21\n\tb\tLBB0_16\nLBB0_16:\n\tldur\tx8, [x29, #-16]\n\tldr\tx8, [x8, #8]\n\tsubs\tx8, x8, #0\n\tcset\tw8, le\n\ttbnz\tw8, #0, LBB0_21\n\tb\tLBB0_17\nLBB0_17:\n\tldur\tx8, [x29, #-16]\n\tldrsw\tx8, [x8, #32]\n\tldur\tx9, [x29, #-16]\n\tldr\tx10, [x9, #16]\n\tmov\tx9, #2\n\tmul\tx9, x9, x10\n\tldur\tx10, [x29, #-16]\n\tldr\tx10, [x10, #8]\n\tmul\tx9, x9, x10\n\tsubs\tx8, x8, x9\n\tcset\tw8, ne\n\ttbnz\tw8, #0, LBB0_21\n\tb\tLBB0_18\nLBB0_18:\n\tldur\tx8, [x29, #-16]\n\tldrsw\tx8, [x8, #36]\n\tldur\tx9, [x29, #-16]\n\tldr\tx10, [x9, #8]\n\tmov\tx9, #2\n\tmul\tx9, x9, x10\n\tsubs\tx8, x8, x9\n\tcset\tw8, ne\n\ttbnz\tw8, #0, LBB0_21\n\tb\tLBB0_19\nLBB0_19:\n\tldur\tx8, [x29, #-16]\n\tldr\tx8, [x8, #24]\n\tsubs\tx8, x8, #16\n\tcset\tw8, ne\n\ttbnz\tw8, #0, LBB0_21\n\tb\tLBB0_20\nLBB0_20:\n\tldur\tw8, [x29, #-24]\n\tstur\tw8, [x29, #-4]\n\tb\tLBB0_29\nLBB0_21:\n\tb\tLBB0_28\nLBB0_22:\n\tldur\tx8, [x29, #-16]\n\tldr\tx9, [x8, #8]\n\tmov\tx8, #3\n\tsubs\tx8, x8, x9\n\tcset\tw8, le\n\ttbnz\tw8, #0, LBB0_27\n\tb\tLBB0_23\nLBB0_23:\n\tldur\tx8, [x29, #-16]\n\tldr\tx8, [x8, #8]\n\tsubs\tx8, x8, #0\n\tcset\tw8, le\n\n```", "role": "user" }, { "content": "```armasm\n\ttbnz\tw8, #0, LBB0_27\n\tb\tLBB0_24\nLBB0_24:\n\tldur\tx8, [x29, #-16]\n\tldr\tx8, [x8, #24]\n\tsubs\tx8, x8, #4\n\tcset\tw8, ne\n\ttbnz\tw8, #0, LBB0_27\n\tb\tLBB0_25\nLBB0_25:\n\tldur\tx8, [x29, #-16]\n\tldr\tw8, [x8, #40]\n\tsubs\tw8, w8, #2\n\tcset\tw8, ne\n\ttbnz\tw8, #0, LBB0_27\n\tb\tLBB0_26\nLBB0_26:\n\tldur\tw8, [x29, #-24]\n\tstur\tw8, [x29, #-4]\n\tb\tLBB0_29\nLBB0_27:\n\tb\tLBB0_28\nLBB0_28:\n\tmov\tw8, #-1\n```", "role": "assistant" } ]
extr_imaadp32.c_ADPCM_GetFormatIndex.c
[ { "content": "You are given an x86 assembly block (<block>) to traspile into armv8_64 assembly.\nYou are also given the context for this block in the form of pre-context (<pre_context>) and post-context (<post_context>).\nThere is also a pre-target-context (<pre_target>) which is the context for the target block. Use the input pre and post context along with the target pre context to transpile the block from x86 to armv8_64.\n\n```x86asm\n; <pre-context>\n\tcmpl\t$2, 40(%rax)\n\tjne\t.LBB0_25\n# %bb.24:\n\tmovl\t-24(%rbp), %eax\n\tmovl\t%eax, -4(%rbp)\n\tjmp\t.LBB0_27\n.LBB0_25:\n\tjmp\t.LBB0_26\n.LBB0_26:\n\n; <block>\n\tmovl\t$-1, -4(%rbp)\n.LBB0_27:\n\tmovl\t-4(%rbp), %eax\n\taddq\t$48, %rsp\n\tpopq\t%rbp\n\t.cfi_def_cfa %rsp, 8\n\tretq\n.Lfunc_end0:\n\t.size\tADPCM_GetFormatIndex, .Lfunc_end0-ADPCM_GetFormatIndex\n\t.cfi_endproc\n # -- End function\n\t.type\tPCM_Formats,@object # @PCM_Formats\n\t.bss\n\t.globl\tPCM_Formats\n\t.p2align\t3, 0x0\nPCM_Formats:\n\t.quad\t0\n\t.size\tPCM_Formats, 8\n\n\t.type\tADPCM_Formats,@object # @ADPCM_Formats\n\t.globl\tADPCM_Formats\n\t.p2align\t3, 0x0\nADPCM_Formats:\n\t.quad\t0\n\t.size\tADPCM_Formats, 8\n\n\t.ident\t\"Ubuntu clang version 18.1.3 (1ubuntu1)\"\n\t.section\t\".note.GNU-stack\",\"\",@progbits\n\t.addrsig\n\t.addrsig_sym ADPCM_GetFormatIndex\n\t.addrsig_sym ARRAY_SIZE\n\t.addrsig_sym PCM_Formats\n\t.addrsig_sym ADPCM_Formats\n\n; <post-context>\n\n```\n\n```armasm\n; <pre-target>\n\t.cfi_startproc\n; %bb.0:\n\tsub\tsp, sp, #80\n\t.cfi_def_cfa_offset 80\n\tstp\tx29, x30, [sp, #64] ; 16-byte Folded Spill\n\tadd\tx29, sp, #64\n\t.cfi_def_cfa w29, 16\n\t.cfi_offset w30, -8\n\t.cfi_offset w29, -16\n\tstur\tx0, [x29, #-16]\n\tldur\tx8, [x29, #-16]\n\tldr\tw8, [x8]\n\tstr\tw8, [sp, #28] ; 4-byte Folded Spill\n\tsubs\tw8, w8, #128\n\tcset\tw8, eq\n\ttbnz\tw8, #0, LBB0_2\n\tb\tLBB0_1\nLBB0_1:\n\tldr\tw8, [sp, #28] ; 4-byte Folded Reload\n\tsubs\tw8, w8, #129\n\tcset\tw8, eq\n\ttbnz\tw8, #0, LBB0_3\n\tb\tLBB0_4\nLBB0_2:\n\tadrp\tx8, _PCM_Formats@GOTPAGE\n\tldr\tx8, [x8, _PCM_Formats@GOTPAGEOFF]\n\tstr\tx8, [sp, #16] ; 8-byte Folded Spill\n\tldr\tx0, [x8]\n\tbl\t_ARRAY_SIZE\n\tldr\tx8, [sp, #16] ; 8-byte Folded Reload\n\tstur\tw0, [x29, #-24]\n\tldr\tx8, [x8]\n\tstr\tx8, [sp, #32]\n\tb\tLBB0_5\nLBB0_3:\n\tadrp\tx8, _ADPCM_Formats@GOTPAGE\n\tldr\tx8, [x8, _ADPCM_Formats@GOTPAGEOFF]\n\tstr\tx8, [sp, #8] ; 8-byte Folded Spill\n\tldr\tx0, [x8]\n\tbl\t_ARRAY_SIZE\n\tldr\tx8, [sp, #8] ; 8-byte Folded Reload\n\tstur\tw0, [x29, #-24]\n\tldr\tx8, [x8]\n\tstr\tx8, [sp, #32]\n\tb\tLBB0_5\nLBB0_4:\n\tmov\tw8, #-1\n\tstur\tw8, [x29, #-4]\n\tb\tLBB0_29\nLBB0_5:\n\tstur\twzr, [x29, #-20]\n\tb\tLBB0_6\nLBB0_6: ; =>This Inner Loop Header: Depth=1\n\tldur\tw8, [x29, #-20]\n\tldur\tw9, [x29, #-24]\n\tsubs\tw8, w8, w9\n\tcset\tw8, ge\n\ttbnz\tw8, #0, LBB0_13\n\tb\tLBB0_7\nLBB0_7: ; in Loop: Header=BB0_6 Depth=1\n\tldur\tx8, [x29, #-16]\n\tldr\tx8, [x8, #8]\n\tldr\tx9, [sp, #32]\n\tldursw\tx10, [x29, #-20]\n\tmov\tx11, #24\n\tmul\tx10, x10, x11\n\tldr\tx9, [x9, x10]\n\tsubs\tx8, x8, x9\n\tcset\tw8, ne\n\ttbnz\tw8, #0, LBB0_11\n\tb\tLBB0_8\nLBB0_8: ; in Loop: Header=BB0_6 Depth=1\n\tldur\tx8, [x29, #-16]\n\tldr\tx8, [x8, #16]\n\tldr\tx9, [sp, #32]\n\tldursw\tx10, [x29, #-20]\n\tmov\tx11, #24\n\tmul\tx10, x10, x11\n\tadd\tx9, x9, x10\n\tldr\tx9, [x9, #8]\n\tsubs\tx8, x8, x9\n\tcset\tw8, ne\n\ttbnz\tw8, #0, LBB0_11\n\tb\tLBB0_9\nLBB0_9: ; in Loop: Header=BB0_6 Depth=1\n\tldur\tx8, [x29, #-16]\n\tmov\tx11, #24\n\tldr\tx8, [x8, #24]\n\tldr\tx9, [sp, #32]\n\tldursw\tx10, [x29, #-20]\n\tmul\tx10, x10, x11\n\tadd\tx9, x9, x10\n\tldr\tx9, [x9, #16]\n\tsubs\tx8, x8, x9\n\tcset\tw8, ne\n\ttbnz\tw8, #0, LBB0_11\n\tb\tLBB0_10\nLBB0_10:\n\tldur\tw8, [x29, #-20]\n\tstur\tw8, [x29, #-4]\n\tb\tLBB0_29\nLBB0_11: ; in Loop: Header=BB0_6 Depth=1\n\tb\tLBB0_12\nLBB0_12: ; in Loop: Header=BB0_6 Depth=1\n\tldur\tw8, [x29, #-20]\n\tadd\tw8, w8, #1\n\tstur\tw8, [x29, #-20]\n\tb\tLBB0_6\nLBB0_13:\n\tldur\tx8, [x29, #-16]\n\tldr\tw8, [x8]\n\tstr\tw8, [sp, #4] ; 4-byte Folded Spill\n\tsubs\tw8, w8, #128\n\tcset\tw8, eq\n\ttbnz\tw8, #0, LBB0_15\n\tb\tLBB0_14\nLBB0_14:\n\tldr\tw8, [sp, #4] ; 4-byte Folded Reload\n\tsubs\tw8, w8, #129\n\tcset\tw8, eq\n\ttbnz\tw8, #0, LBB0_22\n\tb\tLBB0_28\nLBB0_15:\n\tldur\tx8, [x29, #-16]\n\tldr\tx9, [x8, #8]\n\tmov\tx8, #3\n\tsubs\tx8, x8, x9\n\tcset\tw8, le\n\ttbnz\tw8, #0, LBB0_21\n\tb\tLBB0_16\nLBB0_16:\n\tldur\tx8, [x29, #-16]\n\tldr\tx8, [x8, #8]\n\tsubs\tx8, x8, #0\n\tcset\tw8, le\n\ttbnz\tw8, #0, LBB0_21\n\tb\tLBB0_17\nLBB0_17:\n\tldur\tx8, [x29, #-16]\n\tldrsw\tx8, [x8, #32]\n\tldur\tx9, [x29, #-16]\n\tldr\tx10, [x9, #16]\n\tmov\tx9, #2\n\tmul\tx9, x9, x10\n\tldur\tx10, [x29, #-16]\n\tldr\tx10, [x10, #8]\n\tmul\tx9, x9, x10\n\tsubs\tx8, x8, x9\n\tcset\tw8, ne\n\ttbnz\tw8, #0, LBB0_21\n\tb\tLBB0_18\nLBB0_18:\n\tldur\tx8, [x29, #-16]\n\tldrsw\tx8, [x8, #36]\n\tldur\tx9, [x29, #-16]\n\tldr\tx10, [x9, #8]\n\tmov\tx9, #2\n\tmul\tx9, x9, x10\n\tsubs\tx8, x8, x9\n\tcset\tw8, ne\n\ttbnz\tw8, #0, LBB0_21\n\tb\tLBB0_19\nLBB0_19:\n\tldur\tx8, [x29, #-16]\n\tldr\tx8, [x8, #24]\n\tsubs\tx8, x8, #16\n\tcset\tw8, ne\n\ttbnz\tw8, #0, LBB0_21\n\tb\tLBB0_20\nLBB0_20:\n\tldur\tw8, [x29, #-24]\n\tstur\tw8, [x29, #-4]\n\tb\tLBB0_29\nLBB0_21:\n\tb\tLBB0_28\nLBB0_22:\n\tldur\tx8, [x29, #-16]\n\tldr\tx9, [x8, #8]\n\tmov\tx8, #3\n\tsubs\tx8, x8, x9\n\tcset\tw8, le\n\ttbnz\tw8, #0, LBB0_27\n\tb\tLBB0_23\nLBB0_23:\n\tldur\tx8, [x29, #-16]\n\tldr\tx8, [x8, #8]\n\tsubs\tx8, x8, #0\n\tcset\tw8, le\n\ttbnz\tw8, #0, LBB0_27\n\tb\tLBB0_24\nLBB0_24:\n\tldur\tx8, [x29, #-16]\n\tldr\tx8, [x8, #24]\n\tsubs\tx8, x8, #4\n\tcset\tw8, ne\n\ttbnz\tw8, #0, LBB0_27\n\tb\tLBB0_25\nLBB0_25:\n\tldur\tx8, [x29, #-16]\n\tldr\tw8, [x8, #40]\n\tsubs\tw8, w8, #2\n\tcset\tw8, ne\n\ttbnz\tw8, #0, LBB0_27\n\tb\tLBB0_26\nLBB0_26:\n\tldur\tw8, [x29, #-24]\n\tstur\tw8, [x29, #-4]\n\tb\tLBB0_29\nLBB0_27:\n\tb\tLBB0_28\nLBB0_28:\n\tmov\tw8, #-1\n\n```", "role": "user" }, { "content": "```armasm\n\tstur\tw8, [x29, #-4]\n\tb\tLBB0_29\nLBB0_29:\n\tldur\tw0, [x29, #-4]\n\tldp\tx29, x30, [sp, #64] ; 16-byte Folded Reload\n\tadd\tsp, sp, #80\n\tret\n\t.cfi_endproc\n ; -- End function\n\t.comm\t_PCM_Formats,8,3 ; @PCM_Formats\n\t.comm\t_ADPCM_Formats,8,3 ; @ADPCM_Formats\n\t.no_dead_strip\t_ADPCM_GetFormatIndex\n.subsections_via_symbols\n```", "role": "assistant" } ]
extr_al_hal_pcie.c_al_pcie_aer_corr_get_and_clear_aux.c
[ { "content": "You are given an x86 assembly block (<block>) to traspile into armv8_64 assembly.\nYou are also given the context for this block in the form of pre-context (<pre_context>) and post-context (<post_context>).\nThere is also a pre-target-context (<pre_target>) which is the context for the target block. Use the input pre and post context along with the target pre context to transpile the block from x86 to armv8_64.\n\n```x86asm\n; <pre-context>\n\n; <block>\n\t.text\n\t.file\t\"extr_al_hal_pcie.c_al_pcie_aer_corr_get_and_clear_aux.c\"\n\t.p2align\t4, 0x90 # -- Begin function al_pcie_aer_corr_get_and_clear_aux\n\t.type\tal_pcie_aer_corr_get_and_clear_aux,@function\nal_pcie_aer_corr_get_and_clear_aux: # @al_pcie_aer_corr_get_and_clear_aux\n\t.cfi_startproc\n# %bb.0:\n\tpushq\t%rbp\n\t.cfi_def_cfa_offset 16\n\t.cfi_offset %rbp, -16\n\tmovq\t%rsp, %rbp\n\t.cfi_def_cfa_register %rbp\n\tsubq\t$48, %rsp\n\tmovq\t%rdi, -8(%rbp)\n\tmovl\t%esi, -12(%rbp)\n\tmovq\t-8(%rbp), %rax\n\tmovq\t(%rax), %rax\n\tmovq\t%rax, -24(%rbp)\n\tmovq\t-24(%rbp), %rax\n\tmovq\t(%rax), %rax\n\tmovl\t-12(%rbp), %ecx\n # kill: def $rcx killed $ecx\n\tmovq\t(%rax,%rcx,8), %rax\n\tmovq\t%rax, -32(%rbp)\n\tmovq\t-32(%rbp), %rdi\n\n; <post-context>\n\tcallq\tal_reg_read32@PLT\n\tmovl\t%eax, -36(%rbp)\n\tmovq\t-32(%rbp), %rdi\n\tmovl\t-36(%rbp), %esi\n\tcallq\tal_reg_write32@PLT\n\n```\n\n```armasm\n; <pre-target>\n\n```", "role": "user" }, { "content": "```armasm\n\t.section\t__TEXT,__text,regular,pure_instructions\n\t.build_version macos, 13, 0\tsdk_version 13, 3\n\t.p2align\t2 ; -- Begin function al_pcie_aer_corr_get_and_clear_aux\n_al_pcie_aer_corr_get_and_clear_aux: ; @al_pcie_aer_corr_get_and_clear_aux\n\t.cfi_startproc\n; %bb.0:\n\tsub\tsp, sp, #64\n\t.cfi_def_cfa_offset 64\n\tstp\tx29, x30, [sp, #48] ; 16-byte Folded Spill\n\tadd\tx29, sp, #48\n\t.cfi_def_cfa w29, 16\n\t.cfi_offset w30, -8\n\t.cfi_offset w29, -16\n\tstur\tx0, [x29, #-8]\n\tstur\tw1, [x29, #-12]\n\tldur\tx8, [x29, #-8]\n\tldr\tx8, [x8]\n\tstr\tx8, [sp, #24]\n\tldr\tx8, [sp, #24]\n\tldr\tx8, [x8]\n\tldur\tw9, [x29, #-12]\n ; kill: def $x9 killed $w9\n\tldr\tx8, [x8, x9, lsl #3]\n\tstr\tx8, [sp, #16]\n\tldr\tx0, [sp, #16]\n```", "role": "assistant" } ]
extr_al_hal_pcie.c_al_pcie_aer_corr_get_and_clear_aux.c
[ { "content": "You are given an x86 assembly block (<block>) to traspile into armv8_64 assembly.\nYou are also given the context for this block in the form of pre-context (<pre_context>) and post-context (<post_context>).\nThere is also a pre-target-context (<pre_target>) which is the context for the target block. Use the input pre and post context along with the target pre context to transpile the block from x86 to armv8_64.\n\n```x86asm\n; <pre-context>\n\tmovq\t-24(%rbp), %rax\n\tmovq\t(%rax), %rax\n\tmovl\t-12(%rbp), %ecx\n # kill: def $rcx killed $ecx\n\tmovq\t(%rax,%rcx,8), %rax\n\tmovq\t%rax, -32(%rbp)\n\tmovq\t-32(%rbp), %rdi\n\n; <block>\n\tcallq\tal_reg_read32@PLT\n\tmovl\t%eax, -36(%rbp)\n\tmovq\t-32(%rbp), %rdi\n\tmovl\t-36(%rbp), %esi\n\tcallq\tal_reg_write32@PLT\n\tmovl\t-36(%rbp), %eax\n\taddq\t$48, %rsp\n\tpopq\t%rbp\n\t.cfi_def_cfa %rsp, 8\n\tretq\n.Lfunc_end0:\n\t.size\tal_pcie_aer_corr_get_and_clear_aux, .Lfunc_end0-al_pcie_aer_corr_get_and_clear_aux\n\t.cfi_endproc\n # -- End function\n\t.ident\t\"Ubuntu clang version 18.1.3 (1ubuntu1)\"\n\t.section\t\".note.GNU-stack\",\"\",@progbits\n\t.addrsig\n\t.addrsig_sym al_pcie_aer_corr_get_and_clear_aux\n\t.addrsig_sym al_reg_read32\n\t.addrsig_sym al_reg_write32\n\n; <post-context>\n\n```\n\n```armasm\n; <pre-target>\n\t.cfi_startproc\n; %bb.0:\n\tsub\tsp, sp, #64\n\t.cfi_def_cfa_offset 64\n\tstp\tx29, x30, [sp, #48] ; 16-byte Folded Spill\n\tadd\tx29, sp, #48\n\t.cfi_def_cfa w29, 16\n\t.cfi_offset w30, -8\n\t.cfi_offset w29, -16\n\tstur\tx0, [x29, #-8]\n\tstur\tw1, [x29, #-12]\n\tldur\tx8, [x29, #-8]\n\tldr\tx8, [x8]\n\tstr\tx8, [sp, #24]\n\tldr\tx8, [sp, #24]\n\tldr\tx8, [x8]\n\tldur\tw9, [x29, #-12]\n ; kill: def $x9 killed $w9\n\tldr\tx8, [x8, x9, lsl #3]\n\tstr\tx8, [sp, #16]\n\tldr\tx0, [sp, #16]\n\n```", "role": "user" }, { "content": "```armasm\n\tbl\t_al_reg_read32\n\tstr\tw0, [sp, #12]\n\tldr\tx0, [sp, #16]\n\tldr\tw1, [sp, #12]\n\tbl\t_al_reg_write32\n\tldr\tw0, [sp, #12]\n\tldp\tx29, x30, [sp, #48] ; 16-byte Folded Reload\n\tadd\tsp, sp, #64\n\tret\n\t.cfi_endproc\n ; -- End function\n\t.no_dead_strip\t_al_pcie_aer_corr_get_and_clear_aux\n.subsections_via_symbols\n```", "role": "assistant" } ]
extr_en_selftest.c_mlx4_en_test_speed.c
[ { "content": "You are given an x86 assembly block (<block>) to traspile into armv8_64 assembly.\nYou are also given the context for this block in the form of pre-context (<pre_context>) and post-context (<post_context>).\nThere is also a pre-target-context (<pre_target>) which is the context for the target block. Use the input pre and post context along with the target pre context to transpile the block from x86 to armv8_64.\n\n```x86asm\n; <pre-context>\n\n; <block>\n\t.text\n\t.file\t\"extr_en_selftest.c_mlx4_en_test_speed.c\"\n\t.p2align\t4, 0x90 # -- Begin function mlx4_en_test_speed\n\t.type\tmlx4_en_test_speed,@function\nmlx4_en_test_speed: # @mlx4_en_test_speed\n\t.cfi_startproc\n# %bb.0:\n\tpushq\t%rbp\n\t.cfi_def_cfa_offset 16\n\t.cfi_offset %rbp, -16\n\tmovq\t%rsp, %rbp\n\t.cfi_def_cfa_register %rbp\n\tsubq\t$16, %rsp\n\tmovq\t%rdi, -16(%rbp)\n\tmovq\t-16(%rbp), %rax\n\tmovl\t12(%rax), %edi\n\tmovq\t-16(%rbp), %rax\n\tmovl\t8(%rax), %esi\n\tcallq\tmlx4_en_QUERY_PORT@PLT\n\tcmpq\t$0, %rax\n\tje\t.LBB0_2\n# %bb.1:\n\txorl\t%eax, %eax\n\tsubl\tENOMEM(%rip), %eax\n\tmovl\t%eax, -4(%rbp)\n\tjmp\t.LBB0_5\n.LBB0_2:\n\n; <post-context>\n\tmovq\t-16(%rbp), %rax\n\tmovq\t(%rax), %rax\n\tcmpq\tSPEED_10000(%rip), %rax\n\tje\t.LBB0_4\n# %bb.3:\n\tmovq\t-16(%rbp), %rax\n\n```\n\n```armasm\n; <pre-target>\n\n```", "role": "user" }, { "content": "```armasm\n\t.section\t__TEXT,__text,regular,pure_instructions\n\t.build_version macos, 13, 0\tsdk_version 13, 3\n\t.p2align\t2 ; -- Begin function mlx4_en_test_speed\n_mlx4_en_test_speed: ; @mlx4_en_test_speed\n\t.cfi_startproc\n; %bb.0:\n\tsub\tsp, sp, #32\n\t.cfi_def_cfa_offset 32\n\tstp\tx29, x30, [sp, #16] ; 16-byte Folded Spill\n\tadd\tx29, sp, #16\n\t.cfi_def_cfa w29, 16\n\t.cfi_offset w30, -8\n\t.cfi_offset w29, -16\n\tstr\tx0, [sp]\n\tldr\tx8, [sp]\n\tldr\tw0, [x8, #12]\n\tldr\tx8, [sp]\n\tldr\tw1, [x8, #8]\n\tbl\t_mlx4_en_QUERY_PORT\n\tsubs\tx8, x0, #0\n\tcset\tw8, eq\n\ttbnz\tw8, #0, LBB0_2\n\tb\tLBB0_1\nLBB0_1:\n\tadrp\tx8, _ENOMEM@GOTPAGE\n\tldr\tx8, [x8, _ENOMEM@GOTPAGEOFF]\n\tldr\tw9, [x8]\n\tmov\tw8, #0\n\tsubs\tw8, w8, w9\n\tstur\tw8, [x29, #-4]\n\tb\tLBB0_5\nLBB0_2:\n```", "role": "assistant" } ]
extr_en_selftest.c_mlx4_en_test_speed.c
[ { "content": "You are given an x86 assembly block (<block>) to traspile into armv8_64 assembly.\nYou are also given the context for this block in the form of pre-context (<pre_context>) and post-context (<post_context>).\nThere is also a pre-target-context (<pre_target>) which is the context for the target block. Use the input pre and post context along with the target pre context to transpile the block from x86 to armv8_64.\n\n```x86asm\n; <pre-context>\n\tmovl\t8(%rax), %esi\n\tcallq\tmlx4_en_QUERY_PORT@PLT\n\tcmpq\t$0, %rax\n\tje\t.LBB0_2\n# %bb.1:\n\txorl\t%eax, %eax\n\tsubl\tENOMEM(%rip), %eax\n\tmovl\t%eax, -4(%rbp)\n\tjmp\t.LBB0_5\n.LBB0_2:\n\n; <block>\n\tmovq\t-16(%rbp), %rax\n\tmovq\t(%rax), %rax\n\tcmpq\tSPEED_10000(%rip), %rax\n\tje\t.LBB0_4\n# %bb.3:\n\tmovq\t-16(%rbp), %rax\n\tmovq\t(%rax), %rax\n # kill: def $eax killed $eax killed $rax\n\tmovl\t%eax, -4(%rbp)\n\tjmp\t.LBB0_5\n.LBB0_4:\n\tmovl\t$0, -4(%rbp)\n.LBB0_5:\n\tmovl\t-4(%rbp), %eax\n\taddq\t$16, %rsp\n\tpopq\t%rbp\n\t.cfi_def_cfa %rsp, 8\n\tretq\n.Lfunc_end0:\n\t.size\tmlx4_en_test_speed, .Lfunc_end0-mlx4_en_test_speed\n\t.cfi_endproc\n # -- End function\n\t.type\tENOMEM,@object # @ENOMEM\n\t.bss\n\t.globl\tENOMEM\n\t.p2align\t2, 0x0\nENOMEM:\n\t.long\t0 # 0x0\n\t.size\tENOMEM, 4\n\n\t.type\tSPEED_10000,@object # @SPEED_10000\n\t.globl\tSPEED_10000\n\t.p2align\t3, 0x0\nSPEED_10000:\n\t.quad\t0 # 0x0\n\t.size\tSPEED_10000, 8\n\n\t.ident\t\"Ubuntu clang version 18.1.3 (1ubuntu1)\"\n\t.section\t\".note.GNU-stack\",\"\",@progbits\n\t.addrsig\n\t.addrsig_sym mlx4_en_test_speed\n\t.addrsig_sym mlx4_en_QUERY_PORT\n\t.addrsig_sym ENOMEM\n\t.addrsig_sym SPEED_10000\n\n; <post-context>\n\n```\n\n```armasm\n; <pre-target>\n\t.cfi_startproc\n; %bb.0:\n\tsub\tsp, sp, #32\n\t.cfi_def_cfa_offset 32\n\tstp\tx29, x30, [sp, #16] ; 16-byte Folded Spill\n\tadd\tx29, sp, #16\n\t.cfi_def_cfa w29, 16\n\t.cfi_offset w30, -8\n\t.cfi_offset w29, -16\n\tstr\tx0, [sp]\n\tldr\tx8, [sp]\n\tldr\tw0, [x8, #12]\n\tldr\tx8, [sp]\n\tldr\tw1, [x8, #8]\n\tbl\t_mlx4_en_QUERY_PORT\n\tsubs\tx8, x0, #0\n\tcset\tw8, eq\n\ttbnz\tw8, #0, LBB0_2\n\tb\tLBB0_1\nLBB0_1:\n\tadrp\tx8, _ENOMEM@GOTPAGE\n\tldr\tx8, [x8, _ENOMEM@GOTPAGEOFF]\n\tldr\tw9, [x8]\n\tmov\tw8, #0\n\tsubs\tw8, w8, w9\n\tstur\tw8, [x29, #-4]\n\tb\tLBB0_5\nLBB0_2:\n\n```", "role": "user" }, { "content": "```armasm\n\tldr\tx8, [sp]\n\tldr\tx8, [x8]\n\tadrp\tx9, _SPEED_10000@GOTPAGE\n\tldr\tx9, [x9, _SPEED_10000@GOTPAGEOFF]\n\tldr\tx9, [x9]\n\tsubs\tx8, x8, x9\n\tcset\tw8, eq\n\ttbnz\tw8, #0, LBB0_4\n\tb\tLBB0_3\nLBB0_3:\n\tldr\tx8, [sp]\n\tldr\tx8, [x8]\n ; kill: def $w8 killed $w8 killed $x8\n\tstur\tw8, [x29, #-4]\n\tb\tLBB0_5\nLBB0_4:\n\tstur\twzr, [x29, #-4]\n\tb\tLBB0_5\nLBB0_5:\n\tldur\tw0, [x29, #-4]\n\tldp\tx29, x30, [sp, #16] ; 16-byte Folded Reload\n\tadd\tsp, sp, #32\n\tret\n\t.cfi_endproc\n ; -- End function\n\t.comm\t_ENOMEM,4,2 ; @ENOMEM\n\t.comm\t_SPEED_10000,8,3 ; @SPEED_10000\n\t.no_dead_strip\t_mlx4_en_test_speed\n.subsections_via_symbols\n```", "role": "assistant" } ]
extr_zfs_ioctl.c_getzfsvfs.c
[ { "content": "You are given an x86 assembly block (<block>) to traspile into armv8_64 assembly.\nYou are also given the context for this block in the form of pre-context (<pre_context>) and post-context (<post_context>).\nThere is also a pre-target-context (<pre_target>) which is the context for the target block. Use the input pre and post context along with the target pre context to transpile the block from x86 to armv8_64.\n\n```x86asm\n; <pre-context>\n\n; <block>\n\t.text\n\t.file\t\"extr_zfs_ioctl.c_getzfsvfs.c\"\n\t.globl\tgetzfsvfs # -- Begin function getzfsvfs\n\t.p2align\t4, 0x90\n\t.type\tgetzfsvfs,@function\ngetzfsvfs: # @getzfsvfs\n\t.cfi_startproc\n# %bb.0:\n\tpushq\t%rbp\n\t.cfi_def_cfa_offset 16\n\t.cfi_offset %rbp, -16\n\tmovq\t%rsp, %rbp\n\t.cfi_def_cfa_register %rbp\n\tsubq\t$48, %rsp\n\tmovq\t%rdi, -16(%rbp)\n\tmovq\t%rsi, -24(%rbp)\n\tmovq\t-16(%rbp), %rdi\n\tmovl\tFTAG(%rip), %esi\n\tleaq\t-32(%rbp), %rdx\n\tcallq\tdmu_objset_hold@PLT\n\tmovl\t%eax, -44(%rbp)\n\tcmpl\t$0, -44(%rbp)\n\tje\t.LBB0_2\n# %bb.1:\n\tmovl\t-44(%rbp), %eax\n\tmovl\t%eax, -4(%rbp)\n\tjmp\t.LBB0_8\n.LBB0_2:\n\n; <post-context>\n\tmovq\t-32(%rbp), %rdi\n\tleaq\t-40(%rbp), %rsi\n\tcallq\tgetzfsvfs_impl@PLT\n\tmovl\t%eax, -44(%rbp)\n\tmovq\t-32(%rbp), %rdi\n\tmovl\tFTAG(%rip), %esi\n\n```\n\n```armasm\n; <pre-target>\n\n```", "role": "user" }, { "content": "```armasm\n\t.section\t__TEXT,__text,regular,pure_instructions\n\t.build_version macos, 13, 0\tsdk_version 13, 3\n\t.globl\t_getzfsvfs ; -- Begin function getzfsvfs\n\t.p2align\t2\n_getzfsvfs: ; @getzfsvfs\n\t.cfi_startproc\n; %bb.0:\n\tsub\tsp, sp, #64\n\t.cfi_def_cfa_offset 64\n\tstp\tx29, x30, [sp, #48] ; 16-byte Folded Spill\n\tadd\tx29, sp, #48\n\t.cfi_def_cfa w29, 16\n\t.cfi_offset w30, -8\n\t.cfi_offset w29, -16\n\tstur\tx0, [x29, #-16]\n\tstr\tx1, [sp, #24]\n\tldur\tx0, [x29, #-16]\n\tadrp\tx8, _FTAG@GOTPAGE\n\tldr\tx8, [x8, _FTAG@GOTPAGEOFF]\n\tldr\tw1, [x8]\n\tadd\tx2, sp, #16\n\tbl\t_dmu_objset_hold\n\tstr\tw0, [sp, #4]\n\tldr\tw8, [sp, #4]\n\tsubs\tw8, w8, #0\n\tcset\tw8, eq\n\ttbnz\tw8, #0, LBB0_2\n\tb\tLBB0_1\nLBB0_1:\n\tldr\tw8, [sp, #4]\n\tstur\tw8, [x29, #-4]\n\tb\tLBB0_8\nLBB0_2:\n```", "role": "assistant" } ]
extr_zfs_ioctl.c_getzfsvfs.c
[ { "content": "You are given an x86 assembly block (<block>) to traspile into armv8_64 assembly.\nYou are also given the context for this block in the form of pre-context (<pre_context>) and post-context (<post_context>).\nThere is also a pre-target-context (<pre_target>) which is the context for the target block. Use the input pre and post context along with the target pre context to transpile the block from x86 to armv8_64.\n\n```x86asm\n; <pre-context>\n\tmovl\t%eax, -44(%rbp)\n\tcmpl\t$0, -44(%rbp)\n\tje\t.LBB0_2\n# %bb.1:\n\tmovl\t-44(%rbp), %eax\n\tmovl\t%eax, -4(%rbp)\n\tjmp\t.LBB0_8\n.LBB0_2:\n\n; <block>\n\tmovq\t-32(%rbp), %rdi\n\tleaq\t-40(%rbp), %rsi\n\tcallq\tgetzfsvfs_impl@PLT\n\tmovl\t%eax, -44(%rbp)\n\tmovq\t-32(%rbp), %rdi\n\tmovl\tFTAG(%rip), %esi\n\tcallq\tdmu_objset_rele@PLT\n\tcmpl\t$0, -44(%rbp)\n\tje\t.LBB0_4\n# %bb.3:\n\tmovl\t-44(%rbp), %eax\n\tmovl\t%eax, -4(%rbp)\n\tjmp\t.LBB0_8\n.LBB0_4:\n\n; <post-context>\n\tmovq\t-40(%rbp), %rdi\n\txorl\t%esi, %esi\n\tcallq\tvfs_busy@PLT\n\tmovl\t%eax, -44(%rbp)\n\tmovq\t-40(%rbp), %rdi\n\tcallq\tvfs_rel@PLT\n\n```\n\n```armasm\n; <pre-target>\n\t.cfi_startproc\n; %bb.0:\n\tsub\tsp, sp, #64\n\t.cfi_def_cfa_offset 64\n\tstp\tx29, x30, [sp, #48] ; 16-byte Folded Spill\n\tadd\tx29, sp, #48\n\t.cfi_def_cfa w29, 16\n\t.cfi_offset w30, -8\n\t.cfi_offset w29, -16\n\tstur\tx0, [x29, #-16]\n\tstr\tx1, [sp, #24]\n\tldur\tx0, [x29, #-16]\n\tadrp\tx8, _FTAG@GOTPAGE\n\tldr\tx8, [x8, _FTAG@GOTPAGEOFF]\n\tldr\tw1, [x8]\n\tadd\tx2, sp, #16\n\tbl\t_dmu_objset_hold\n\tstr\tw0, [sp, #4]\n\tldr\tw8, [sp, #4]\n\tsubs\tw8, w8, #0\n\tcset\tw8, eq\n\ttbnz\tw8, #0, LBB0_2\n\tb\tLBB0_1\nLBB0_1:\n\tldr\tw8, [sp, #4]\n\tstur\tw8, [x29, #-4]\n\tb\tLBB0_8\nLBB0_2:\n\n```", "role": "user" }, { "content": "```armasm\n\tldr\tx0, [sp, #16]\n\tadd\tx1, sp, #8\n\tbl\t_getzfsvfs_impl\n\tstr\tw0, [sp, #4]\n\tldr\tx0, [sp, #16]\n\tadrp\tx8, _FTAG@GOTPAGE\n\tldr\tx8, [x8, _FTAG@GOTPAGEOFF]\n\tldr\tw1, [x8]\n\tbl\t_dmu_objset_rele\n\tldr\tw8, [sp, #4]\n\tsubs\tw8, w8, #0\n\tcset\tw8, eq\n\ttbnz\tw8, #0, LBB0_4\n\tb\tLBB0_3\nLBB0_3:\n\tldr\tw8, [sp, #4]\n\tstur\tw8, [x29, #-4]\n\tb\tLBB0_8\nLBB0_4:\n```", "role": "assistant" } ]
extr_zfs_ioctl.c_getzfsvfs.c
[ { "content": "You are given an x86 assembly block (<block>) to traspile into armv8_64 assembly.\nYou are also given the context for this block in the form of pre-context (<pre_context>) and post-context (<post_context>).\nThere is also a pre-target-context (<pre_target>) which is the context for the target block. Use the input pre and post context along with the target pre context to transpile the block from x86 to armv8_64.\n\n```x86asm\n; <pre-context>\n\tcallq\tdmu_objset_rele@PLT\n\tcmpl\t$0, -44(%rbp)\n\tje\t.LBB0_4\n# %bb.3:\n\tmovl\t-44(%rbp), %eax\n\tmovl\t%eax, -4(%rbp)\n\tjmp\t.LBB0_8\n.LBB0_4:\n\n; <block>\n\tmovq\t-40(%rbp), %rdi\n\txorl\t%esi, %esi\n\tcallq\tvfs_busy@PLT\n\tmovl\t%eax, -44(%rbp)\n\tmovq\t-40(%rbp), %rdi\n\tcallq\tvfs_rel@PLT\n\tcmpl\t$0, -44(%rbp)\n\tje\t.LBB0_6\n# %bb.5:\n\tmovq\t-24(%rbp), %rax\n\tmovq\t$0, (%rax)\n\tmovl\tESRCH(%rip), %edi\n\n; <post-context>\n\tcallq\tSET_ERROR@PLT\n\tmovl\t%eax, -44(%rbp)\n\tjmp\t.LBB0_7\n.LBB0_6:\n\tmovq\t-40(%rbp), %rax\n\tmovq\t(%rax), %rcx\n\n```\n\n```armasm\n; <pre-target>\n\t.cfi_startproc\n; %bb.0:\n\tsub\tsp, sp, #64\n\t.cfi_def_cfa_offset 64\n\tstp\tx29, x30, [sp, #48] ; 16-byte Folded Spill\n\tadd\tx29, sp, #48\n\t.cfi_def_cfa w29, 16\n\t.cfi_offset w30, -8\n\t.cfi_offset w29, -16\n\tstur\tx0, [x29, #-16]\n\tstr\tx1, [sp, #24]\n\tldur\tx0, [x29, #-16]\n\tadrp\tx8, _FTAG@GOTPAGE\n\tldr\tx8, [x8, _FTAG@GOTPAGEOFF]\n\tldr\tw1, [x8]\n\tadd\tx2, sp, #16\n\tbl\t_dmu_objset_hold\n\tstr\tw0, [sp, #4]\n\tldr\tw8, [sp, #4]\n\tsubs\tw8, w8, #0\n\tcset\tw8, eq\n\ttbnz\tw8, #0, LBB0_2\n\tb\tLBB0_1\nLBB0_1:\n\tldr\tw8, [sp, #4]\n\tstur\tw8, [x29, #-4]\n\tb\tLBB0_8\nLBB0_2:\n\tldr\tx0, [sp, #16]\n\tadd\tx1, sp, #8\n\tbl\t_getzfsvfs_impl\n\tstr\tw0, [sp, #4]\n\tldr\tx0, [sp, #16]\n\tadrp\tx8, _FTAG@GOTPAGE\n\tldr\tx8, [x8, _FTAG@GOTPAGEOFF]\n\tldr\tw1, [x8]\n\tbl\t_dmu_objset_rele\n\tldr\tw8, [sp, #4]\n\tsubs\tw8, w8, #0\n\tcset\tw8, eq\n\ttbnz\tw8, #0, LBB0_4\n\tb\tLBB0_3\nLBB0_3:\n\tldr\tw8, [sp, #4]\n\tstur\tw8, [x29, #-4]\n\tb\tLBB0_8\nLBB0_4:\n\n```", "role": "user" }, { "content": "```armasm\n\tldr\tx0, [sp, #8]\n\tmov\tw1, #0\n\tbl\t_vfs_busy\n\tstr\tw0, [sp, #4]\n\tldr\tx0, [sp, #8]\n\tbl\t_vfs_rel\n\tldr\tw8, [sp, #4]\n\tsubs\tw8, w8, #0\n\tcset\tw8, eq\n\ttbnz\tw8, #0, LBB0_6\n\tb\tLBB0_5\nLBB0_5:\n\tldr\tx8, [sp, #24]\n ; kill: def $x9 killed $xzr\n\tstr\txzr, [x8]\n\tadrp\tx8, _ESRCH@GOTPAGE\n\tldr\tx8, [x8, _ESRCH@GOTPAGEOFF]\n\tldr\tw0, [x8]\n```", "role": "assistant" } ]
extr_zfs_ioctl.c_getzfsvfs.c
[ { "content": "You are given an x86 assembly block (<block>) to traspile into armv8_64 assembly.\nYou are also given the context for this block in the form of pre-context (<pre_context>) and post-context (<post_context>).\nThere is also a pre-target-context (<pre_target>) which is the context for the target block. Use the input pre and post context along with the target pre context to transpile the block from x86 to armv8_64.\n\n```x86asm\n; <pre-context>\n\tcmpl\t$0, -44(%rbp)\n\tje\t.LBB0_6\n# %bb.5:\n\tmovq\t-24(%rbp), %rax\n\tmovq\t$0, (%rax)\n\tmovl\tESRCH(%rip), %edi\n\n; <block>\n\tcallq\tSET_ERROR@PLT\n\tmovl\t%eax, -44(%rbp)\n\tjmp\t.LBB0_7\n.LBB0_6:\n\tmovq\t-40(%rbp), %rax\n\tmovq\t(%rax), %rcx\n\tmovq\t-24(%rbp), %rax\n\tmovq\t%rcx, (%rax)\n.LBB0_7:\n\tmovl\t-44(%rbp), %eax\n\tmovl\t%eax, -4(%rbp)\n.LBB0_8:\n\tmovl\t-4(%rbp), %eax\n\taddq\t$48, %rsp\n\tpopq\t%rbp\n\t.cfi_def_cfa %rsp, 8\n\tretq\n.Lfunc_end0:\n\t.size\tgetzfsvfs, .Lfunc_end0-getzfsvfs\n\t.cfi_endproc\n # -- End function\n\t.type\tFTAG,@object # @FTAG\n\t.bss\n\t.globl\tFTAG\n\t.p2align\t2, 0x0\nFTAG:\n\t.long\t0 # 0x0\n\t.size\tFTAG, 4\n\n\t.type\tESRCH,@object # @ESRCH\n\t.globl\tESRCH\n\t.p2align\t2, 0x0\nESRCH:\n\t.long\t0 # 0x0\n\t.size\tESRCH, 4\n\n\t.ident\t\"Ubuntu clang version 18.1.3 (1ubuntu1)\"\n\t.section\t\".note.GNU-stack\",\"\",@progbits\n\t.addrsig\n\t.addrsig_sym dmu_objset_hold\n\t.addrsig_sym getzfsvfs_impl\n\t.addrsig_sym dmu_objset_rele\n\t.addrsig_sym vfs_busy\n\t.addrsig_sym vfs_rel\n\t.addrsig_sym SET_ERROR\n\t.addrsig_sym FTAG\n\t.addrsig_sym ESRCH\n\n; <post-context>\n\n```\n\n```armasm\n; <pre-target>\n\t.cfi_startproc\n; %bb.0:\n\tsub\tsp, sp, #64\n\t.cfi_def_cfa_offset 64\n\tstp\tx29, x30, [sp, #48] ; 16-byte Folded Spill\n\tadd\tx29, sp, #48\n\t.cfi_def_cfa w29, 16\n\t.cfi_offset w30, -8\n\t.cfi_offset w29, -16\n\tstur\tx0, [x29, #-16]\n\tstr\tx1, [sp, #24]\n\tldur\tx0, [x29, #-16]\n\tadrp\tx8, _FTAG@GOTPAGE\n\tldr\tx8, [x8, _FTAG@GOTPAGEOFF]\n\tldr\tw1, [x8]\n\tadd\tx2, sp, #16\n\tbl\t_dmu_objset_hold\n\tstr\tw0, [sp, #4]\n\tldr\tw8, [sp, #4]\n\tsubs\tw8, w8, #0\n\tcset\tw8, eq\n\ttbnz\tw8, #0, LBB0_2\n\tb\tLBB0_1\nLBB0_1:\n\tldr\tw8, [sp, #4]\n\tstur\tw8, [x29, #-4]\n\tb\tLBB0_8\nLBB0_2:\n\tldr\tx0, [sp, #16]\n\tadd\tx1, sp, #8\n\tbl\t_getzfsvfs_impl\n\tstr\tw0, [sp, #4]\n\tldr\tx0, [sp, #16]\n\tadrp\tx8, _FTAG@GOTPAGE\n\tldr\tx8, [x8, _FTAG@GOTPAGEOFF]\n\tldr\tw1, [x8]\n\tbl\t_dmu_objset_rele\n\tldr\tw8, [sp, #4]\n\tsubs\tw8, w8, #0\n\tcset\tw8, eq\n\ttbnz\tw8, #0, LBB0_4\n\tb\tLBB0_3\nLBB0_3:\n\tldr\tw8, [sp, #4]\n\tstur\tw8, [x29, #-4]\n\tb\tLBB0_8\nLBB0_4:\n\tldr\tx0, [sp, #8]\n\tmov\tw1, #0\n\tbl\t_vfs_busy\n\tstr\tw0, [sp, #4]\n\tldr\tx0, [sp, #8]\n\tbl\t_vfs_rel\n\tldr\tw8, [sp, #4]\n\tsubs\tw8, w8, #0\n\tcset\tw8, eq\n\ttbnz\tw8, #0, LBB0_6\n\tb\tLBB0_5\nLBB0_5:\n\tldr\tx8, [sp, #24]\n ; kill: def $x9 killed $xzr\n\tstr\txzr, [x8]\n\tadrp\tx8, _ESRCH@GOTPAGE\n\tldr\tx8, [x8, _ESRCH@GOTPAGEOFF]\n\tldr\tw0, [x8]\n\n```", "role": "user" }, { "content": "```armasm\n\tbl\t_SET_ERROR\n\tstr\tw0, [sp, #4]\n\tb\tLBB0_7\nLBB0_6:\n\tldr\tx8, [sp, #8]\n\tldr\tx8, [x8]\n\tldr\tx9, [sp, #24]\n\tstr\tx8, [x9]\n\tb\tLBB0_7\nLBB0_7:\n\tldr\tw8, [sp, #4]\n\tstur\tw8, [x29, #-4]\n\tb\tLBB0_8\nLBB0_8:\n\tldur\tw0, [x29, #-4]\n\tldp\tx29, x30, [sp, #48] ; 16-byte Folded Reload\n\tadd\tsp, sp, #64\n\tret\n\t.cfi_endproc\n ; -- End function\n\t.comm\t_FTAG,4,2 ; @FTAG\n\t.comm\t_ESRCH,4,2 ; @ESRCH\n.subsections_via_symbols\n```", "role": "assistant" } ]
extr_umad.c_check_for_digit_name.c
[ { "content": "You are given an x86 assembly block (<block>) to traspile into armv8_64 assembly.\nYou are also given the context for this block in the form of pre-context (<pre_context>) and post-context (<post_context>).\nThere is also a pre-target-context (<pre_target>) which is the context for the target block. Use the input pre and post context along with the target pre context to transpile the block from x86 to armv8_64.\n\n```x86asm\n; <pre-context>\n\n; <block>\n\t.text\n\t.file\t\"extr_umad.c_check_for_digit_name.c\"\n\t.p2align\t4, 0x90 # -- Begin function check_for_digit_name\n\t.type\tcheck_for_digit_name,@function\ncheck_for_digit_name: # @check_for_digit_name\n\t.cfi_startproc\n# %bb.0:\n\tpushq\t%rbp\n\t.cfi_def_cfa_offset 16\n\t.cfi_offset %rbp, -16\n\tmovq\t%rsp, %rbp\n\t.cfi_def_cfa_register %rbp\n\tsubq\t$32, %rsp\n\tmovq\t%rdi, -8(%rbp)\n\tmovq\t-8(%rbp), %rax\n\tmovq\t(%rax), %rax\n\tmovq\t%rax, -16(%rbp)\n.LBB0_1: # =>This Inner Loop Header: Depth=1\n\tmovq\t-16(%rbp), %rax\n\tmovsbl\t(%rax), %ecx\n\txorl\t%eax, %eax\n # kill: def $al killed $al killed $eax\n\tcmpl\t$0, %ecx\n\tmovb\t%al, -17(%rbp) # 1-byte Spill\n\tje\t.LBB0_3\n# %bb.2: # in Loop: Header=BB0_1 Depth=1\n\tmovq\t-16(%rbp), %rax\n\tmovsbl\t(%rax), %edi\n\tcallq\tisdigit@PLT\n\n; <post-context>\n\tcmpq\t$0, %rax\n\tsetne\t%al\n\tmovb\t%al, -17(%rbp) # 1-byte Spill\n.LBB0_3: # in Loop: Header=BB0_1 Depth=1\n\tmovb\t-17(%rbp), %al # 1-byte Reload\n\ttestb\t$1, %al\n\tjne\t.LBB0_4\n\tjmp\t.LBB0_5\n.LBB0_4: # in Loop: Header=BB0_1 Depth=1\n\tmovq\t-16(%rbp), %rax\n\taddq\t$1, %rax\n\tmovq\t%rax, -16(%rbp)\n\tjmp\t.LBB0_1\n.LBB0_5:\n\n```\n\n```armasm\n; <pre-target>\n\n```", "role": "user" }, { "content": "```armasm\n\t.section\t__TEXT,__text,regular,pure_instructions\n\t.build_version macos, 13, 0\tsdk_version 13, 3\n\t.p2align\t2 ; -- Begin function check_for_digit_name\n_check_for_digit_name: ; @check_for_digit_name\n\t.cfi_startproc\n; %bb.0:\n\tsub\tsp, sp, #48\n\t.cfi_def_cfa_offset 48\n\tstp\tx29, x30, [sp, #32] ; 16-byte Folded Spill\n\tadd\tx29, sp, #32\n\t.cfi_def_cfa w29, 16\n\t.cfi_offset w30, -8\n\t.cfi_offset w29, -16\n\tstur\tx0, [x29, #-8]\n\tldur\tx8, [x29, #-8]\n\tldr\tx8, [x8]\n\tstr\tx8, [sp, #16]\n\tb\tLBB0_1\nLBB0_1: ; =>This Inner Loop Header: Depth=1\n\tldr\tx8, [sp, #16]\n\tldrsb\tw8, [x8]\n\tsubs\tw8, w8, #0\n\tcset\tw8, eq\n\tmov\tw9, #0\n\tstr\tw9, [sp, #12] ; 4-byte Folded Spill\n\ttbnz\tw8, #0, LBB0_3\n\tb\tLBB0_2\nLBB0_2: ; in Loop: Header=BB0_1 Depth=1\n\tldr\tx8, [sp, #16]\n\tldrsb\tw0, [x8]\n\tbl\t_isdigit\n```", "role": "assistant" } ]
extr_umad.c_check_for_digit_name.c
[ { "content": "You are given an x86 assembly block (<block>) to traspile into armv8_64 assembly.\nYou are also given the context for this block in the form of pre-context (<pre_context>) and post-context (<post_context>).\nThere is also a pre-target-context (<pre_target>) which is the context for the target block. Use the input pre and post context along with the target pre context to transpile the block from x86 to armv8_64.\n\n```x86asm\n; <pre-context>\n\tmovq\t-16(%rbp), %rax\n\tmovsbl\t(%rax), %ecx\n\txorl\t%eax, %eax\n # kill: def $al killed $al killed $eax\n\tcmpl\t$0, %ecx\n\tmovb\t%al, -17(%rbp) # 1-byte Spill\n\tje\t.LBB0_3\n# %bb.2: # in Loop: Header=BB0_1 Depth=1\n\tmovq\t-16(%rbp), %rax\n\tmovsbl\t(%rax), %edi\n\tcallq\tisdigit@PLT\n\n; <block>\n\tcmpq\t$0, %rax\n\tsetne\t%al\n\tmovb\t%al, -17(%rbp) # 1-byte Spill\n.LBB0_3: # in Loop: Header=BB0_1 Depth=1\n\tmovb\t-17(%rbp), %al # 1-byte Reload\n\ttestb\t$1, %al\n\tjne\t.LBB0_4\n\tjmp\t.LBB0_5\n.LBB0_4: # in Loop: Header=BB0_1 Depth=1\n\tmovq\t-16(%rbp), %rax\n\taddq\t$1, %rax\n\tmovq\t%rax, -16(%rbp)\n\tjmp\t.LBB0_1\n.LBB0_5:\n\tmovq\t-16(%rbp), %rax\n\tmovsbl\t(%rax), %edx\n\tmovl\t$1, %eax\n\txorl\t%ecx, %ecx\n\tcmpl\t$0, %edx\n\tcmovnel\t%ecx, %eax\n\taddq\t$32, %rsp\n\tpopq\t%rbp\n\t.cfi_def_cfa %rsp, 8\n\tretq\n.Lfunc_end0:\n\t.size\tcheck_for_digit_name, .Lfunc_end0-check_for_digit_name\n\t.cfi_endproc\n # -- End function\n\t.ident\t\"Ubuntu clang version 18.1.3 (1ubuntu1)\"\n\t.section\t\".note.GNU-stack\",\"\",@progbits\n\t.addrsig\n\t.addrsig_sym check_for_digit_name\n\t.addrsig_sym isdigit\n\n; <post-context>\n\n```\n\n```armasm\n; <pre-target>\n\t.cfi_startproc\n; %bb.0:\n\tsub\tsp, sp, #48\n\t.cfi_def_cfa_offset 48\n\tstp\tx29, x30, [sp, #32] ; 16-byte Folded Spill\n\tadd\tx29, sp, #32\n\t.cfi_def_cfa w29, 16\n\t.cfi_offset w30, -8\n\t.cfi_offset w29, -16\n\tstur\tx0, [x29, #-8]\n\tldur\tx8, [x29, #-8]\n\tldr\tx8, [x8]\n\tstr\tx8, [sp, #16]\n\tb\tLBB0_1\nLBB0_1: ; =>This Inner Loop Header: Depth=1\n\tldr\tx8, [sp, #16]\n\tldrsb\tw8, [x8]\n\tsubs\tw8, w8, #0\n\tcset\tw8, eq\n\tmov\tw9, #0\n\tstr\tw9, [sp, #12] ; 4-byte Folded Spill\n\ttbnz\tw8, #0, LBB0_3\n\tb\tLBB0_2\nLBB0_2: ; in Loop: Header=BB0_1 Depth=1\n\tldr\tx8, [sp, #16]\n\tldrsb\tw0, [x8]\n\tbl\t_isdigit\n\n```", "role": "user" }, { "content": "```armasm\n\tsubs\tx8, x0, #0\n\tcset\tw8, ne\n\tstr\tw8, [sp, #12] ; 4-byte Folded Spill\n\tb\tLBB0_3\nLBB0_3: ; in Loop: Header=BB0_1 Depth=1\n\tldr\tw8, [sp, #12] ; 4-byte Folded Reload\n\ttbz\tw8, #0, LBB0_5\n\tb\tLBB0_4\nLBB0_4: ; in Loop: Header=BB0_1 Depth=1\n\tldr\tx8, [sp, #16]\n\tadd\tx8, x8, #1\n\tstr\tx8, [sp, #16]\n\tb\tLBB0_1\nLBB0_5:\n\tldr\tx8, [sp, #16]\n\tldrsb\tw8, [x8]\n\tsubs\tw8, w8, #0\n\tcset\tw8, ne\n\tand\tw8, w8, #0x1\n\tands\tw8, w8, #0x1\n\tcset\tw0, eq\n\tldp\tx29, x30, [sp, #32] ; 16-byte Folded Reload\n\tadd\tsp, sp, #48\n\tret\n\t.cfi_endproc\n ; -- End function\n\t.no_dead_strip\t_check_for_digit_name\n.subsections_via_symbols\n```", "role": "assistant" } ]
extr_panel-dsi-cm.c_dsicm_enter_ulps.c
[ { "content": "You are given an x86 assembly block (<block>) to traspile into armv8_64 assembly.\nYou are also given the context for this block in the form of pre-context (<pre_context>) and post-context (<post_context>).\nThere is also a pre-target-context (<pre_target>) which is the context for the target block. Use the input pre and post context along with the target pre context to transpile the block from x86 to armv8_64.\n\n```x86asm\n; <pre-context>\n\n; <block>\n\t.text\n\t.file\t\"extr_panel-dsi-cm.c_dsicm_enter_ulps.c\"\n\t.p2align\t4, 0x90 # -- Begin function dsicm_enter_ulps\n\t.type\tdsicm_enter_ulps,@function\ndsicm_enter_ulps: # @dsicm_enter_ulps\n\t.cfi_startproc\n# %bb.0:\n\tpushq\t%rbp\n\t.cfi_def_cfa_offset 16\n\t.cfi_offset %rbp, -16\n\tmovq\t%rsp, %rbp\n\t.cfi_def_cfa_register %rbp\n\tsubq\t$32, %rsp\n\tmovq\t%rdi, -16(%rbp)\n\tmovq\t-16(%rbp), %rax\n\tmovq\t24(%rax), %rax\n\tmovq\t%rax, -24(%rbp)\n\tmovq\t-16(%rbp), %rax\n\tcmpl\t$0, (%rax)\n\tje\t.LBB0_2\n# %bb.1:\n\tmovl\t$0, -4(%rbp)\n\tjmp\t.LBB0_8\n.LBB0_2:\n\tmovq\t-16(%rbp), %rdi\n\tcallq\tdsicm_cancel_ulps_work@PLT\n\n; <post-context>\n\tmovq\t-16(%rbp), %rdi\n\txorl\t%esi, %esi\n\tcallq\t_dsicm_enable_te@PLT\n\tmovl\t%eax, -28(%rbp)\n\tcmpl\t$0, -28(%rbp)\n\tje\t.LBB0_4\n# %bb.3:\n\n```\n\n```armasm\n; <pre-target>\n\n```", "role": "user" }, { "content": "```armasm\n\t.section\t__TEXT,__text,regular,pure_instructions\n\t.build_version macos, 13, 0\tsdk_version 13, 3\n\t.p2align\t2 ; -- Begin function dsicm_enter_ulps\n_dsicm_enter_ulps: ; @dsicm_enter_ulps\n\t.cfi_startproc\n; %bb.0:\n\tsub\tsp, sp, #48\n\t.cfi_def_cfa_offset 48\n\tstp\tx29, x30, [sp, #32] ; 16-byte Folded Spill\n\tadd\tx29, sp, #32\n\t.cfi_def_cfa w29, 16\n\t.cfi_offset w30, -8\n\t.cfi_offset w29, -16\n\tstr\tx0, [sp, #16]\n\tldr\tx8, [sp, #16]\n\tldr\tx8, [x8, #24]\n\tstr\tx8, [sp, #8]\n\tldr\tx8, [sp, #16]\n\tldr\tw8, [x8]\n\tsubs\tw8, w8, #0\n\tcset\tw8, eq\n\ttbnz\tw8, #0, LBB0_2\n\tb\tLBB0_1\nLBB0_1:\n\tstur\twzr, [x29, #-4]\n\tb\tLBB0_8\nLBB0_2:\n\tldr\tx0, [sp, #16]\n\tbl\t_dsicm_cancel_ulps_work\n```", "role": "assistant" } ]
extr_panel-dsi-cm.c_dsicm_enter_ulps.c
[ { "content": "You are given an x86 assembly block (<block>) to traspile into armv8_64 assembly.\nYou are also given the context for this block in the form of pre-context (<pre_context>) and post-context (<post_context>).\nThere is also a pre-target-context (<pre_target>) which is the context for the target block. Use the input pre and post context along with the target pre context to transpile the block from x86 to armv8_64.\n\n```x86asm\n; <pre-context>\n\tmovq\t-16(%rbp), %rax\n\tcmpl\t$0, (%rax)\n\tje\t.LBB0_2\n# %bb.1:\n\tmovl\t$0, -4(%rbp)\n\tjmp\t.LBB0_8\n.LBB0_2:\n\tmovq\t-16(%rbp), %rdi\n\tcallq\tdsicm_cancel_ulps_work@PLT\n\n; <block>\n\tmovq\t-16(%rbp), %rdi\n\txorl\t%esi, %esi\n\tcallq\t_dsicm_enable_te@PLT\n\tmovl\t%eax, -28(%rbp)\n\tcmpl\t$0, -28(%rbp)\n\tje\t.LBB0_4\n# %bb.3:\n\tjmp\t.LBB0_7\n.LBB0_4:\n\tmovq\t-16(%rbp), %rax\n\tmovl\t16(%rax), %edi\n\tcallq\tgpio_is_valid@PLT\n\tcmpq\t$0, %rax\n\tje\t.LBB0_6\n# %bb.5:\n\n; <post-context>\n\tmovq\t-16(%rbp), %rax\n\tmovl\t16(%rax), %edi\n\tcallq\tgpio_to_irq@PLT\n\tmovl\t%eax, %edi\n\tcallq\tdisable_irq@PLT\n.LBB0_6:\n\tmovq\t-24(%rbp), %rax\n\n```\n\n```armasm\n; <pre-target>\n\t.cfi_startproc\n; %bb.0:\n\tsub\tsp, sp, #48\n\t.cfi_def_cfa_offset 48\n\tstp\tx29, x30, [sp, #32] ; 16-byte Folded Spill\n\tadd\tx29, sp, #32\n\t.cfi_def_cfa w29, 16\n\t.cfi_offset w30, -8\n\t.cfi_offset w29, -16\n\tstr\tx0, [sp, #16]\n\tldr\tx8, [sp, #16]\n\tldr\tx8, [x8, #24]\n\tstr\tx8, [sp, #8]\n\tldr\tx8, [sp, #16]\n\tldr\tw8, [x8]\n\tsubs\tw8, w8, #0\n\tcset\tw8, eq\n\ttbnz\tw8, #0, LBB0_2\n\tb\tLBB0_1\nLBB0_1:\n\tstur\twzr, [x29, #-4]\n\tb\tLBB0_8\nLBB0_2:\n\tldr\tx0, [sp, #16]\n\tbl\t_dsicm_cancel_ulps_work\n\n```", "role": "user" }, { "content": "```armasm\n\tldr\tx0, [sp, #16]\n\tmov\tw1, #0\n\tbl\t__dsicm_enable_te\n\tstr\tw0, [sp, #4]\n\tldr\tw8, [sp, #4]\n\tsubs\tw8, w8, #0\n\tcset\tw8, eq\n\ttbnz\tw8, #0, LBB0_4\n\tb\tLBB0_3\nLBB0_3:\n\tb\tLBB0_7\nLBB0_4:\n\tldr\tx8, [sp, #16]\n\tldr\tw0, [x8, #16]\n\tbl\t_gpio_is_valid\n\tsubs\tx8, x0, #0\n\tcset\tw8, eq\n\ttbnz\tw8, #0, LBB0_6\n\tb\tLBB0_5\nLBB0_5:\n```", "role": "assistant" } ]
extr_panel-dsi-cm.c_dsicm_enter_ulps.c
[ { "content": "You are given an x86 assembly block (<block>) to traspile into armv8_64 assembly.\nYou are also given the context for this block in the form of pre-context (<pre_context>) and post-context (<post_context>).\nThere is also a pre-target-context (<pre_target>) which is the context for the target block. Use the input pre and post context along with the target pre context to transpile the block from x86 to armv8_64.\n\n```x86asm\n; <pre-context>\n\tjmp\t.LBB0_7\n.LBB0_4:\n\tmovq\t-16(%rbp), %rax\n\tmovl\t16(%rax), %edi\n\tcallq\tgpio_is_valid@PLT\n\tcmpq\t$0, %rax\n\tje\t.LBB0_6\n# %bb.5:\n\n; <block>\n\tmovq\t-16(%rbp), %rax\n\tmovl\t16(%rax), %edi\n\tcallq\tgpio_to_irq@PLT\n\tmovl\t%eax, %edi\n\tcallq\tdisable_irq@PLT\n.LBB0_6:\n\tmovq\t-24(%rbp), %rax\n\tmovq\t(%rax), %rax\n\tmovq\t(%rax), %rax\n\tmovq\t-24(%rbp), %rdi\n\txorl\t%esi, %esi\n\tmovl\t$1, %edx\n\tcallq\t*%rax\n\tmovq\t-16(%rbp), %rax\n\tmovl\t$1, (%rax)\n\n; <post-context>\n\tmovl\t$0, -4(%rbp)\n\tjmp\t.LBB0_8\n.LBB0_7:\n\tmovq\t-16(%rbp), %rax\n\tmovq\t8(%rax), %rdi\n\tleaq\t.L.str(%rip), %rsi\n\tcallq\tdev_err@PLT\n\tmovq\t-16(%rbp), %rdi\n\n```\n\n```armasm\n; <pre-target>\n\t.cfi_startproc\n; %bb.0:\n\tsub\tsp, sp, #48\n\t.cfi_def_cfa_offset 48\n\tstp\tx29, x30, [sp, #32] ; 16-byte Folded Spill\n\tadd\tx29, sp, #32\n\t.cfi_def_cfa w29, 16\n\t.cfi_offset w30, -8\n\t.cfi_offset w29, -16\n\tstr\tx0, [sp, #16]\n\tldr\tx8, [sp, #16]\n\tldr\tx8, [x8, #24]\n\tstr\tx8, [sp, #8]\n\tldr\tx8, [sp, #16]\n\tldr\tw8, [x8]\n\tsubs\tw8, w8, #0\n\tcset\tw8, eq\n\ttbnz\tw8, #0, LBB0_2\n\tb\tLBB0_1\nLBB0_1:\n\tstur\twzr, [x29, #-4]\n\tb\tLBB0_8\nLBB0_2:\n\tldr\tx0, [sp, #16]\n\tbl\t_dsicm_cancel_ulps_work\n\tldr\tx0, [sp, #16]\n\tmov\tw1, #0\n\tbl\t__dsicm_enable_te\n\tstr\tw0, [sp, #4]\n\tldr\tw8, [sp, #4]\n\tsubs\tw8, w8, #0\n\tcset\tw8, eq\n\ttbnz\tw8, #0, LBB0_4\n\tb\tLBB0_3\nLBB0_3:\n\tb\tLBB0_7\nLBB0_4:\n\tldr\tx8, [sp, #16]\n\tldr\tw0, [x8, #16]\n\tbl\t_gpio_is_valid\n\tsubs\tx8, x0, #0\n\tcset\tw8, eq\n\ttbnz\tw8, #0, LBB0_6\n\tb\tLBB0_5\nLBB0_5:\n\n```", "role": "user" }, { "content": "```armasm\n\tldr\tx8, [sp, #16]\n\tldr\tw0, [x8, #16]\n\tbl\t_gpio_to_irq\n\tbl\t_disable_irq\n\tb\tLBB0_6\nLBB0_6:\n\tldr\tx8, [sp, #8]\n\tldr\tx8, [x8]\n\tldr\tx8, [x8]\n\tldr\tx0, [sp, #8]\n\tmov\tw1, #0\n\tmov\tw2, #1\n\tstr\tw2, [sp] ; 4-byte Folded Spill\n\tblr\tx8\n\tldr\tw8, [sp] ; 4-byte Folded Reload\n\tldr\tx9, [sp, #16]\n\tstr\tw8, [x9]\n```", "role": "assistant" } ]
extr_panel-dsi-cm.c_dsicm_enter_ulps.c
[ { "content": "You are given an x86 assembly block (<block>) to traspile into armv8_64 assembly.\nYou are also given the context for this block in the form of pre-context (<pre_context>) and post-context (<post_context>).\nThere is also a pre-target-context (<pre_target>) which is the context for the target block. Use the input pre and post context along with the target pre context to transpile the block from x86 to armv8_64.\n\n```x86asm\n; <pre-context>\n\tmovq\t(%rax), %rax\n\tmovq\t(%rax), %rax\n\tmovq\t-24(%rbp), %rdi\n\txorl\t%esi, %esi\n\tmovl\t$1, %edx\n\tcallq\t*%rax\n\tmovq\t-16(%rbp), %rax\n\tmovl\t$1, (%rax)\n\n; <block>\n\tmovl\t$0, -4(%rbp)\n\tjmp\t.LBB0_8\n.LBB0_7:\n\tmovq\t-16(%rbp), %rax\n\tmovq\t8(%rax), %rdi\n\tleaq\t.L.str(%rip), %rsi\n\tcallq\tdev_err@PLT\n\tmovq\t-16(%rbp), %rdi\n\tcallq\tdsicm_panel_reset@PLT\n\tmovq\t-16(%rbp), %rax\n\tmovl\t$0, (%rax)\n\tmovq\t-16(%rbp), %rdi\n\tcallq\tdsicm_queue_ulps_work@PLT\n\n; <post-context>\n\tmovl\t-28(%rbp), %eax\n\tmovl\t%eax, -4(%rbp)\n.LBB0_8:\n\tmovl\t-4(%rbp), %eax\n\taddq\t$32, %rsp\n\tpopq\t%rbp\n\t.cfi_def_cfa %rsp, 8\n\tretq\n.Lfunc_end0:\n\t.size\tdsicm_enter_ulps, .Lfunc_end0-dsicm_enter_ulps\n\t.cfi_endproc\n # -- End function\n\t.type\t.L.str,@object # @.str\n\t.section\t.rodata.str1.1,\"aMS\",@progbits,1\n.L.str:\n\t.asciz\t\"enter ULPS failed\"\n\t.size\t.L.str, 18\n\n\t.ident\t\"Ubuntu clang version 18.1.3 (1ubuntu1)\"\n\t.section\t\".note.GNU-stack\",\"\",@progbits\n\t.addrsig\n\t.addrsig_sym dsicm_enter_ulps\n\t.addrsig_sym dsicm_cancel_ulps_work\n\t.addrsig_sym _dsicm_enable_te\n\t.addrsig_sym gpio_is_valid\n\t.addrsig_sym disable_irq\n\t.addrsig_sym gpio_to_irq\n\t.addrsig_sym dev_err\n\t.addrsig_sym dsicm_panel_reset\n\t.addrsig_sym dsicm_queue_ulps_work\n\n```\n\n```armasm\n; <pre-target>\n\t.cfi_startproc\n; %bb.0:\n\tsub\tsp, sp, #48\n\t.cfi_def_cfa_offset 48\n\tstp\tx29, x30, [sp, #32] ; 16-byte Folded Spill\n\tadd\tx29, sp, #32\n\t.cfi_def_cfa w29, 16\n\t.cfi_offset w30, -8\n\t.cfi_offset w29, -16\n\tstr\tx0, [sp, #16]\n\tldr\tx8, [sp, #16]\n\tldr\tx8, [x8, #24]\n\tstr\tx8, [sp, #8]\n\tldr\tx8, [sp, #16]\n\tldr\tw8, [x8]\n\tsubs\tw8, w8, #0\n\tcset\tw8, eq\n\ttbnz\tw8, #0, LBB0_2\n\tb\tLBB0_1\nLBB0_1:\n\tstur\twzr, [x29, #-4]\n\tb\tLBB0_8\nLBB0_2:\n\tldr\tx0, [sp, #16]\n\tbl\t_dsicm_cancel_ulps_work\n\tldr\tx0, [sp, #16]\n\tmov\tw1, #0\n\tbl\t__dsicm_enable_te\n\tstr\tw0, [sp, #4]\n\tldr\tw8, [sp, #4]\n\tsubs\tw8, w8, #0\n\tcset\tw8, eq\n\ttbnz\tw8, #0, LBB0_4\n\tb\tLBB0_3\nLBB0_3:\n\tb\tLBB0_7\nLBB0_4:\n\tldr\tx8, [sp, #16]\n\tldr\tw0, [x8, #16]\n\tbl\t_gpio_is_valid\n\tsubs\tx8, x0, #0\n\tcset\tw8, eq\n\ttbnz\tw8, #0, LBB0_6\n\tb\tLBB0_5\nLBB0_5:\n\tldr\tx8, [sp, #16]\n\tldr\tw0, [x8, #16]\n\tbl\t_gpio_to_irq\n\tbl\t_disable_irq\n\tb\tLBB0_6\nLBB0_6:\n\tldr\tx8, [sp, #8]\n\tldr\tx8, [x8]\n\tldr\tx8, [x8]\n\tldr\tx0, [sp, #8]\n\tmov\tw1, #0\n\tmov\tw2, #1\n\tstr\tw2, [sp] ; 4-byte Folded Spill\n\tblr\tx8\n\tldr\tw8, [sp] ; 4-byte Folded Reload\n\tldr\tx9, [sp, #16]\n\tstr\tw8, [x9]\n\n```", "role": "user" }, { "content": "```armasm\n\tstur\twzr, [x29, #-4]\n\tb\tLBB0_8\nLBB0_7:\n\tldr\tx8, [sp, #16]\n\tldr\tx0, [x8, #8]\n\tadrp\tx1, l_.str@PAGE\n\tadd\tx1, x1, l_.str@PAGEOFF\n\tbl\t_dev_err\n\tldr\tx0, [sp, #16]\n\tbl\t_dsicm_panel_reset\n\tldr\tx8, [sp, #16]\n\tstr\twzr, [x8]\n\tldr\tx0, [sp, #16]\n\tbl\t_dsicm_queue_ulps_work\n```", "role": "assistant" } ]
extr_panel-dsi-cm.c_dsicm_enter_ulps.c
[ { "content": "You are given an x86 assembly block (<block>) to traspile into armv8_64 assembly.\nYou are also given the context for this block in the form of pre-context (<pre_context>) and post-context (<post_context>).\nThere is also a pre-target-context (<pre_target>) which is the context for the target block. Use the input pre and post context along with the target pre context to transpile the block from x86 to armv8_64.\n\n```x86asm\n; <pre-context>\n\tcallq\tdsicm_panel_reset@PLT\n\tmovq\t-16(%rbp), %rax\n\tmovl\t$0, (%rax)\n\tmovq\t-16(%rbp), %rdi\n\tcallq\tdsicm_queue_ulps_work@PLT\n\n; <block>\n\tmovl\t-28(%rbp), %eax\n\tmovl\t%eax, -4(%rbp)\n.LBB0_8:\n\tmovl\t-4(%rbp), %eax\n\taddq\t$32, %rsp\n\tpopq\t%rbp\n\t.cfi_def_cfa %rsp, 8\n\tretq\n.Lfunc_end0:\n\t.size\tdsicm_enter_ulps, .Lfunc_end0-dsicm_enter_ulps\n\t.cfi_endproc\n # -- End function\n\t.type\t.L.str,@object # @.str\n\t.section\t.rodata.str1.1,\"aMS\",@progbits,1\n.L.str:\n\t.asciz\t\"enter ULPS failed\"\n\t.size\t.L.str, 18\n\n\t.ident\t\"Ubuntu clang version 18.1.3 (1ubuntu1)\"\n\t.section\t\".note.GNU-stack\",\"\",@progbits\n\t.addrsig\n\t.addrsig_sym dsicm_enter_ulps\n\t.addrsig_sym dsicm_cancel_ulps_work\n\t.addrsig_sym _dsicm_enable_te\n\t.addrsig_sym gpio_is_valid\n\t.addrsig_sym disable_irq\n\t.addrsig_sym gpio_to_irq\n\t.addrsig_sym dev_err\n\t.addrsig_sym dsicm_panel_reset\n\t.addrsig_sym dsicm_queue_ulps_work\n\n; <post-context>\n\n```\n\n```armasm\n; <pre-target>\n\t.cfi_startproc\n; %bb.0:\n\tsub\tsp, sp, #48\n\t.cfi_def_cfa_offset 48\n\tstp\tx29, x30, [sp, #32] ; 16-byte Folded Spill\n\tadd\tx29, sp, #32\n\t.cfi_def_cfa w29, 16\n\t.cfi_offset w30, -8\n\t.cfi_offset w29, -16\n\tstr\tx0, [sp, #16]\n\tldr\tx8, [sp, #16]\n\tldr\tx8, [x8, #24]\n\tstr\tx8, [sp, #8]\n\tldr\tx8, [sp, #16]\n\tldr\tw8, [x8]\n\tsubs\tw8, w8, #0\n\tcset\tw8, eq\n\ttbnz\tw8, #0, LBB0_2\n\tb\tLBB0_1\nLBB0_1:\n\tstur\twzr, [x29, #-4]\n\tb\tLBB0_8\nLBB0_2:\n\tldr\tx0, [sp, #16]\n\tbl\t_dsicm_cancel_ulps_work\n\tldr\tx0, [sp, #16]\n\tmov\tw1, #0\n\tbl\t__dsicm_enable_te\n\tstr\tw0, [sp, #4]\n\tldr\tw8, [sp, #4]\n\tsubs\tw8, w8, #0\n\tcset\tw8, eq\n\ttbnz\tw8, #0, LBB0_4\n\tb\tLBB0_3\nLBB0_3:\n\tb\tLBB0_7\nLBB0_4:\n\tldr\tx8, [sp, #16]\n\tldr\tw0, [x8, #16]\n\tbl\t_gpio_is_valid\n\tsubs\tx8, x0, #0\n\tcset\tw8, eq\n\ttbnz\tw8, #0, LBB0_6\n\tb\tLBB0_5\nLBB0_5:\n\tldr\tx8, [sp, #16]\n\tldr\tw0, [x8, #16]\n\tbl\t_gpio_to_irq\n\tbl\t_disable_irq\n\tb\tLBB0_6\nLBB0_6:\n\tldr\tx8, [sp, #8]\n\tldr\tx8, [x8]\n\tldr\tx8, [x8]\n\tldr\tx0, [sp, #8]\n\tmov\tw1, #0\n\tmov\tw2, #1\n\tstr\tw2, [sp] ; 4-byte Folded Spill\n\tblr\tx8\n\tldr\tw8, [sp] ; 4-byte Folded Reload\n\tldr\tx9, [sp, #16]\n\tstr\tw8, [x9]\n\tstur\twzr, [x29, #-4]\n\tb\tLBB0_8\nLBB0_7:\n\tldr\tx8, [sp, #16]\n\tldr\tx0, [x8, #8]\n\tadrp\tx1, l_.str@PAGE\n\tadd\tx1, x1, l_.str@PAGEOFF\n\tbl\t_dev_err\n\tldr\tx0, [sp, #16]\n\tbl\t_dsicm_panel_reset\n\tldr\tx8, [sp, #16]\n\tstr\twzr, [x8]\n\tldr\tx0, [sp, #16]\n\tbl\t_dsicm_queue_ulps_work\n\n```", "role": "user" }, { "content": "```armasm\n\tldr\tw8, [sp, #4]\n\tstur\tw8, [x29, #-4]\n\tb\tLBB0_8\nLBB0_8:\n\tldur\tw0, [x29, #-4]\n\tldp\tx29, x30, [sp, #32] ; 16-byte Folded Reload\n\tadd\tsp, sp, #48\n\tret\n\t.cfi_endproc\n ; -- End function\n\t.section\t__TEXT,__cstring,cstring_literals\nl_.str: ; @.str\n\t.asciz\t\"enter ULPS failed\"\n\n\t.no_dead_strip\t_dsicm_enter_ulps\n.subsections_via_symbols\n```", "role": "assistant" } ]
extr_dnxhddec.c_dnxhd_decode_dct_block_10_444.c
[ { "content": "You are given an x86 assembly block (<block>) to traspile into armv8_64 assembly.\nYou are also given the context for this block in the form of pre-context (<pre_context>) and post-context (<post_context>).\nThere is also a pre-target-context (<pre_target>) which is the context for the target block. Use the input pre and post context along with the target pre context to transpile the block from x86 to armv8_64.\n\n```x86asm\n; <pre-context>\n\n; <block>\n\t.text\n\t.file\t\"extr_dnxhddec.c_dnxhd_decode_dct_block_10_444.c\"\n\t.p2align\t4, 0x90 # -- Begin function dnxhd_decode_dct_block_10_444\n\t.type\tdnxhd_decode_dct_block_10_444,@function\ndnxhd_decode_dct_block_10_444: # @dnxhd_decode_dct_block_10_444\n\t.cfi_startproc\n# %bb.0:\n\tpushq\t%rbp\n\t.cfi_def_cfa_offset 16\n\t.cfi_offset %rbp, -16\n\tmovq\t%rsp, %rbp\n\t.cfi_def_cfa_register %rbp\n\tsubq\t$32, %rsp\n\tmovq\t%rdi, -8(%rbp)\n\tmovq\t%rsi, -16(%rbp)\n\tmovl\t%edx, -20(%rbp)\n\tmovq\t-8(%rbp), %rdi\n\tmovq\t-16(%rbp), %rsi\n\tmovl\t-20(%rbp), %edx\n\tmovl\t$6, %r9d\n\tmovl\t$32, %r8d\n\txorl\t%eax, %eax\n\tmovl\t%r9d, %ecx\n\tmovl\t$0, (%rsp)\n\tcallq\tdnxhd_decode_dct_block@PLT\n\taddq\t$32, %rsp\n\tpopq\t%rbp\n\t.cfi_def_cfa %rsp, 8\n\tretq\n.Lfunc_end0:\n\t.size\tdnxhd_decode_dct_block_10_444, .Lfunc_end0-dnxhd_decode_dct_block_10_444\n\t.cfi_endproc\n # -- End function\n\t.ident\t\"Ubuntu clang version 18.1.3 (1ubuntu1)\"\n\t.section\t\".note.GNU-stack\",\"\",@progbits\n\t.addrsig\n\t.addrsig_sym dnxhd_decode_dct_block_10_444\n\t.addrsig_sym dnxhd_decode_dct_block\n\n; <post-context>\n\n```\n\n```armasm\n; <pre-target>\n\n```", "role": "user" }, { "content": "```armasm\n\t.section\t__TEXT,__text,regular,pure_instructions\n\t.build_version macos, 13, 0\tsdk_version 13, 3\n\t.p2align\t2 ; -- Begin function dnxhd_decode_dct_block_10_444\n_dnxhd_decode_dct_block_10_444: ; @dnxhd_decode_dct_block_10_444\n\t.cfi_startproc\n; %bb.0:\n\tsub\tsp, sp, #48\n\t.cfi_def_cfa_offset 48\n\tstp\tx29, x30, [sp, #32] ; 16-byte Folded Spill\n\tadd\tx29, sp, #32\n\t.cfi_def_cfa w29, 16\n\t.cfi_offset w30, -8\n\t.cfi_offset w29, -16\n\tstur\tx0, [x29, #-8]\n\tstr\tx1, [sp, #16]\n\tstr\tw2, [sp, #12]\n\tldur\tx0, [x29, #-8]\n\tldr\tx1, [sp, #16]\n\tldr\tw2, [sp, #12]\n\tmov\tw5, #6\n\tmov\tx3, x5\n\tmov\tw4, #32\n\tmov\tw6, #0\n\tbl\t_dnxhd_decode_dct_block\n\tldp\tx29, x30, [sp, #32] ; 16-byte Folded Reload\n\tadd\tsp, sp, #48\n\tret\n\t.cfi_endproc\n ; -- End function\n\t.no_dead_strip\t_dnxhd_decode_dct_block_10_444\n.subsections_via_symbols\n```", "role": "assistant" } ]
extr_ltablib.c_maxn.c
[ { "content": "You are given an x86 assembly block (<block>) to traspile into armv8_64 assembly.\nYou are also given the context for this block in the form of pre-context (<pre_context>) and post-context (<post_context>).\nThere is also a pre-target-context (<pre_target>) which is the context for the target block. Use the input pre and post context along with the target pre context to transpile the block from x86 to armv8_64.\n\n```x86asm\n; <pre-context>\n\n; <block>\n\t.text\n\t.file\t\"extr_ltablib.c_maxn.c\"\n\t.p2align\t4, 0x90 # -- Begin function maxn\n\t.type\tmaxn,@function\nmaxn: # @maxn\n\t.cfi_startproc\n# %bb.0:\n\tpushq\t%rbp\n\t.cfi_def_cfa_offset 16\n\t.cfi_offset %rbp, -16\n\tmovq\t%rsp, %rbp\n\t.cfi_def_cfa_register %rbp\n\tsubq\t$32, %rsp\n\tmovq\t%rdi, -8(%rbp)\n\tmovq\t$0, -16(%rbp)\n\tmovq\t-8(%rbp), %rdi\n\tmovl\tLUA_TTABLE(%rip), %edx\n\tmovl\t$1, %esi\n\tcallq\tluaL_checktype@PLT\n\tmovq\t-8(%rbp), %rdi\n\tcallq\tlua_pushnil@PLT\n.LBB0_1: # =>This Inner Loop Header: Depth=1\n\tmovq\t-8(%rbp), %rdi\n\tmovl\t$1, %esi\n\tcallq\tlua_next@PLT\n\n; <post-context>\n\tcmpq\t$0, %rax\n\tje\t.LBB0_7\n# %bb.2: # in Loop: Header=BB0_1 Depth=1\n\tmovq\t-8(%rbp), %rdi\n\tmovl\t$1, %esi\n\tcallq\tlua_pop@PLT\n\tmovq\t-8(%rbp), %rdi\n\tmovl\t$4294967295, %esi # imm = 0xFFFFFFFF\n\tcallq\tlua_type@PLT\n\n```\n\n```armasm\n; <pre-target>\n\n```", "role": "user" }, { "content": "```armasm\n\t.section\t__TEXT,__text,regular,pure_instructions\n\t.build_version macos, 13, 0\tsdk_version 13, 3\n\t.p2align\t2 ; -- Begin function maxn\n_maxn: ; @maxn\n\t.cfi_startproc\n; %bb.0:\n\tsub\tsp, sp, #48\n\t.cfi_def_cfa_offset 48\n\tstp\tx29, x30, [sp, #32] ; 16-byte Folded Spill\n\tadd\tx29, sp, #32\n\t.cfi_def_cfa w29, 16\n\t.cfi_offset w30, -8\n\t.cfi_offset w29, -16\n\tstur\tx0, [x29, #-8]\n\tstr\txzr, [sp, #16]\n\tldur\tx0, [x29, #-8]\n\tadrp\tx8, _LUA_TTABLE@GOTPAGE\n\tldr\tx8, [x8, _LUA_TTABLE@GOTPAGEOFF]\n\tldr\tw2, [x8]\n\tmov\tw1, #1\n\tbl\t_luaL_checktype\n\tldur\tx0, [x29, #-8]\n\tbl\t_lua_pushnil\n\tb\tLBB0_1\nLBB0_1: ; =>This Inner Loop Header: Depth=1\n\tldur\tx0, [x29, #-8]\n\tmov\tw1, #1\n\tbl\t_lua_next\n```", "role": "assistant" } ]
extr_ltablib.c_maxn.c
[ { "content": "You are given an x86 assembly block (<block>) to traspile into armv8_64 assembly.\nYou are also given the context for this block in the form of pre-context (<pre_context>) and post-context (<post_context>).\nThere is also a pre-target-context (<pre_target>) which is the context for the target block. Use the input pre and post context along with the target pre context to transpile the block from x86 to armv8_64.\n\n```x86asm\n; <pre-context>\n\tmovl\t$1, %esi\n\tcallq\tluaL_checktype@PLT\n\tmovq\t-8(%rbp), %rdi\n\tcallq\tlua_pushnil@PLT\n.LBB0_1: # =>This Inner Loop Header: Depth=1\n\tmovq\t-8(%rbp), %rdi\n\tmovl\t$1, %esi\n\tcallq\tlua_next@PLT\n\n; <block>\n\tcmpq\t$0, %rax\n\tje\t.LBB0_7\n# %bb.2: # in Loop: Header=BB0_1 Depth=1\n\tmovq\t-8(%rbp), %rdi\n\tmovl\t$1, %esi\n\tcallq\tlua_pop@PLT\n\tmovq\t-8(%rbp), %rdi\n\tmovl\t$4294967295, %esi # imm = 0xFFFFFFFF\n\tcallq\tlua_type@PLT\n\tcmpq\tLUA_TNUMBER(%rip), %rax\n\tjne\t.LBB0_6\n# %bb.3: # in Loop: Header=BB0_1 Depth=1\n\tmovq\t-8(%rbp), %rdi\n\tmovl\t$4294967295, %esi # imm = 0xFFFFFFFF\n\tcallq\tlua_tonumber@PLT\n\tmovq\t%rax, -24(%rbp)\n\n; <post-context>\n\tmovq\t-24(%rbp), %rax\n\tcmpq\t-16(%rbp), %rax\n\tjle\t.LBB0_5\n# %bb.4: # in Loop: Header=BB0_1 Depth=1\n\tmovq\t-24(%rbp), %rax\n\tmovq\t%rax, -16(%rbp)\n.LBB0_5: # in Loop: Header=BB0_1 Depth=1\n\n```\n\n```armasm\n; <pre-target>\n\t.cfi_startproc\n; %bb.0:\n\tsub\tsp, sp, #48\n\t.cfi_def_cfa_offset 48\n\tstp\tx29, x30, [sp, #32] ; 16-byte Folded Spill\n\tadd\tx29, sp, #32\n\t.cfi_def_cfa w29, 16\n\t.cfi_offset w30, -8\n\t.cfi_offset w29, -16\n\tstur\tx0, [x29, #-8]\n\tstr\txzr, [sp, #16]\n\tldur\tx0, [x29, #-8]\n\tadrp\tx8, _LUA_TTABLE@GOTPAGE\n\tldr\tx8, [x8, _LUA_TTABLE@GOTPAGEOFF]\n\tldr\tw2, [x8]\n\tmov\tw1, #1\n\tbl\t_luaL_checktype\n\tldur\tx0, [x29, #-8]\n\tbl\t_lua_pushnil\n\tb\tLBB0_1\nLBB0_1: ; =>This Inner Loop Header: Depth=1\n\tldur\tx0, [x29, #-8]\n\tmov\tw1, #1\n\tbl\t_lua_next\n\n```", "role": "user" }, { "content": "```armasm\n\tsubs\tx8, x0, #0\n\tcset\tw8, eq\n\ttbnz\tw8, #0, LBB0_7\n\tb\tLBB0_2\nLBB0_2: ; in Loop: Header=BB0_1 Depth=1\n\tldur\tx0, [x29, #-8]\n\tmov\tw1, #1\n\tbl\t_lua_pop\n\tldur\tx0, [x29, #-8]\n\tmov\tw1, #-1\n\tbl\t_lua_type\n\tadrp\tx8, _LUA_TNUMBER@GOTPAGE\n\tldr\tx8, [x8, _LUA_TNUMBER@GOTPAGEOFF]\n\tldr\tx8, [x8]\n\tsubs\tx8, x0, x8\n\tcset\tw8, ne\n\ttbnz\tw8, #0, LBB0_6\n\tb\tLBB0_3\nLBB0_3: ; in Loop: Header=BB0_1 Depth=1\n\tldur\tx0, [x29, #-8]\n\tmov\tw1, #-1\n\tbl\t_lua_tonumber\n\tstr\tx0, [sp, #8]\n```", "role": "assistant" } ]
extr_ltablib.c_maxn.c
[ { "content": "You are given an x86 assembly block (<block>) to traspile into armv8_64 assembly.\nYou are also given the context for this block in the form of pre-context (<pre_context>) and post-context (<post_context>).\nThere is also a pre-target-context (<pre_target>) which is the context for the target block. Use the input pre and post context along with the target pre context to transpile the block from x86 to armv8_64.\n\n```x86asm\n; <pre-context>\n\tcmpq\tLUA_TNUMBER(%rip), %rax\n\tjne\t.LBB0_6\n# %bb.3: # in Loop: Header=BB0_1 Depth=1\n\tmovq\t-8(%rbp), %rdi\n\tmovl\t$4294967295, %esi # imm = 0xFFFFFFFF\n\tcallq\tlua_tonumber@PLT\n\tmovq\t%rax, -24(%rbp)\n\n; <block>\n\tmovq\t-24(%rbp), %rax\n\tcmpq\t-16(%rbp), %rax\n\tjle\t.LBB0_5\n# %bb.4: # in Loop: Header=BB0_1 Depth=1\n\tmovq\t-24(%rbp), %rax\n\tmovq\t%rax, -16(%rbp)\n.LBB0_5: # in Loop: Header=BB0_1 Depth=1\n\tjmp\t.LBB0_6\n.LBB0_6: # in Loop: Header=BB0_1 Depth=1\n\tjmp\t.LBB0_1\n.LBB0_7:\n\tmovq\t-8(%rbp), %rdi\n\tmovq\t-16(%rbp), %rsi\n\tcallq\tlua_pushnumber@PLT\n\tmovl\t$1, %eax\n\n; <post-context>\n\taddq\t$32, %rsp\n\tpopq\t%rbp\n\t.cfi_def_cfa %rsp, 8\n\tretq\n.Lfunc_end0:\n\t.size\tmaxn, .Lfunc_end0-maxn\n\t.cfi_endproc\n # -- End function\n\t.type\tLUA_TTABLE,@object # @LUA_TTABLE\n\t.bss\n\t.globl\tLUA_TTABLE\n\t.p2align\t2, 0x0\nLUA_TTABLE:\n\t.long\t0 # 0x0\n\t.size\tLUA_TTABLE, 4\n\n\t.type\tLUA_TNUMBER,@object # @LUA_TNUMBER\n\t.globl\tLUA_TNUMBER\n\t.p2align\t3, 0x0\nLUA_TNUMBER:\n\t.quad\t0 # 0x0\n\t.size\tLUA_TNUMBER, 8\n\n\t.ident\t\"Ubuntu clang version 18.1.3 (1ubuntu1)\"\n\t.section\t\".note.GNU-stack\",\"\",@progbits\n\t.addrsig\n\t.addrsig_sym maxn\n\t.addrsig_sym luaL_checktype\n\t.addrsig_sym lua_pushnil\n\t.addrsig_sym lua_next\n\t.addrsig_sym lua_pop\n\t.addrsig_sym lua_type\n\t.addrsig_sym lua_tonumber\n\t.addrsig_sym lua_pushnumber\n\t.addrsig_sym LUA_TTABLE\n\t.addrsig_sym LUA_TNUMBER\n\n```\n\n```armasm\n; <pre-target>\n\t.cfi_startproc\n; %bb.0:\n\tsub\tsp, sp, #48\n\t.cfi_def_cfa_offset 48\n\tstp\tx29, x30, [sp, #32] ; 16-byte Folded Spill\n\tadd\tx29, sp, #32\n\t.cfi_def_cfa w29, 16\n\t.cfi_offset w30, -8\n\t.cfi_offset w29, -16\n\tstur\tx0, [x29, #-8]\n\tstr\txzr, [sp, #16]\n\tldur\tx0, [x29, #-8]\n\tadrp\tx8, _LUA_TTABLE@GOTPAGE\n\tldr\tx8, [x8, _LUA_TTABLE@GOTPAGEOFF]\n\tldr\tw2, [x8]\n\tmov\tw1, #1\n\tbl\t_luaL_checktype\n\tldur\tx0, [x29, #-8]\n\tbl\t_lua_pushnil\n\tb\tLBB0_1\nLBB0_1: ; =>This Inner Loop Header: Depth=1\n\tldur\tx0, [x29, #-8]\n\tmov\tw1, #1\n\tbl\t_lua_next\n\tsubs\tx8, x0, #0\n\tcset\tw8, eq\n\ttbnz\tw8, #0, LBB0_7\n\tb\tLBB0_2\nLBB0_2: ; in Loop: Header=BB0_1 Depth=1\n\tldur\tx0, [x29, #-8]\n\tmov\tw1, #1\n\tbl\t_lua_pop\n\tldur\tx0, [x29, #-8]\n\tmov\tw1, #-1\n\tbl\t_lua_type\n\tadrp\tx8, _LUA_TNUMBER@GOTPAGE\n\tldr\tx8, [x8, _LUA_TNUMBER@GOTPAGEOFF]\n\tldr\tx8, [x8]\n\tsubs\tx8, x0, x8\n\tcset\tw8, ne\n\ttbnz\tw8, #0, LBB0_6\n\tb\tLBB0_3\nLBB0_3: ; in Loop: Header=BB0_1 Depth=1\n\tldur\tx0, [x29, #-8]\n\tmov\tw1, #-1\n\tbl\t_lua_tonumber\n\tstr\tx0, [sp, #8]\n\n```", "role": "user" }, { "content": "```armasm\n\tldr\tx8, [sp, #8]\n\tldr\tx9, [sp, #16]\n\tsubs\tx8, x8, x9\n\tcset\tw8, le\n\ttbnz\tw8, #0, LBB0_5\n\tb\tLBB0_4\nLBB0_4: ; in Loop: Header=BB0_1 Depth=1\n\tldr\tx8, [sp, #8]\n\tstr\tx8, [sp, #16]\n\tb\tLBB0_5\nLBB0_5: ; in Loop: Header=BB0_1 Depth=1\n\tb\tLBB0_6\nLBB0_6: ; in Loop: Header=BB0_1 Depth=1\n\tb\tLBB0_1\nLBB0_7:\n\tldur\tx0, [x29, #-8]\n\tldr\tx1, [sp, #16]\n\tbl\t_lua_pushnumber\n\tmov\tw0, #1\n```", "role": "assistant" } ]
extr_ltablib.c_maxn.c
[ { "content": "You are given an x86 assembly block (<block>) to traspile into armv8_64 assembly.\nYou are also given the context for this block in the form of pre-context (<pre_context>) and post-context (<post_context>).\nThere is also a pre-target-context (<pre_target>) which is the context for the target block. Use the input pre and post context along with the target pre context to transpile the block from x86 to armv8_64.\n\n```x86asm\n; <pre-context>\n\tjmp\t.LBB0_6\n.LBB0_6: # in Loop: Header=BB0_1 Depth=1\n\tjmp\t.LBB0_1\n.LBB0_7:\n\tmovq\t-8(%rbp), %rdi\n\tmovq\t-16(%rbp), %rsi\n\tcallq\tlua_pushnumber@PLT\n\tmovl\t$1, %eax\n\n; <block>\n\taddq\t$32, %rsp\n\tpopq\t%rbp\n\t.cfi_def_cfa %rsp, 8\n\tretq\n.Lfunc_end0:\n\t.size\tmaxn, .Lfunc_end0-maxn\n\t.cfi_endproc\n # -- End function\n\t.type\tLUA_TTABLE,@object # @LUA_TTABLE\n\t.bss\n\t.globl\tLUA_TTABLE\n\t.p2align\t2, 0x0\nLUA_TTABLE:\n\t.long\t0 # 0x0\n\t.size\tLUA_TTABLE, 4\n\n\t.type\tLUA_TNUMBER,@object # @LUA_TNUMBER\n\t.globl\tLUA_TNUMBER\n\t.p2align\t3, 0x0\nLUA_TNUMBER:\n\t.quad\t0 # 0x0\n\t.size\tLUA_TNUMBER, 8\n\n\t.ident\t\"Ubuntu clang version 18.1.3 (1ubuntu1)\"\n\t.section\t\".note.GNU-stack\",\"\",@progbits\n\t.addrsig\n\t.addrsig_sym maxn\n\t.addrsig_sym luaL_checktype\n\t.addrsig_sym lua_pushnil\n\t.addrsig_sym lua_next\n\t.addrsig_sym lua_pop\n\t.addrsig_sym lua_type\n\t.addrsig_sym lua_tonumber\n\t.addrsig_sym lua_pushnumber\n\t.addrsig_sym LUA_TTABLE\n\t.addrsig_sym LUA_TNUMBER\n\n; <post-context>\n\n```\n\n```armasm\n; <pre-target>\n\t.cfi_startproc\n; %bb.0:\n\tsub\tsp, sp, #48\n\t.cfi_def_cfa_offset 48\n\tstp\tx29, x30, [sp, #32] ; 16-byte Folded Spill\n\tadd\tx29, sp, #32\n\t.cfi_def_cfa w29, 16\n\t.cfi_offset w30, -8\n\t.cfi_offset w29, -16\n\tstur\tx0, [x29, #-8]\n\tstr\txzr, [sp, #16]\n\tldur\tx0, [x29, #-8]\n\tadrp\tx8, _LUA_TTABLE@GOTPAGE\n\tldr\tx8, [x8, _LUA_TTABLE@GOTPAGEOFF]\n\tldr\tw2, [x8]\n\tmov\tw1, #1\n\tbl\t_luaL_checktype\n\tldur\tx0, [x29, #-8]\n\tbl\t_lua_pushnil\n\tb\tLBB0_1\nLBB0_1: ; =>This Inner Loop Header: Depth=1\n\tldur\tx0, [x29, #-8]\n\tmov\tw1, #1\n\tbl\t_lua_next\n\tsubs\tx8, x0, #0\n\tcset\tw8, eq\n\ttbnz\tw8, #0, LBB0_7\n\tb\tLBB0_2\nLBB0_2: ; in Loop: Header=BB0_1 Depth=1\n\tldur\tx0, [x29, #-8]\n\tmov\tw1, #1\n\tbl\t_lua_pop\n\tldur\tx0, [x29, #-8]\n\tmov\tw1, #-1\n\tbl\t_lua_type\n\tadrp\tx8, _LUA_TNUMBER@GOTPAGE\n\tldr\tx8, [x8, _LUA_TNUMBER@GOTPAGEOFF]\n\tldr\tx8, [x8]\n\tsubs\tx8, x0, x8\n\tcset\tw8, ne\n\ttbnz\tw8, #0, LBB0_6\n\tb\tLBB0_3\nLBB0_3: ; in Loop: Header=BB0_1 Depth=1\n\tldur\tx0, [x29, #-8]\n\tmov\tw1, #-1\n\tbl\t_lua_tonumber\n\tstr\tx0, [sp, #8]\n\tldr\tx8, [sp, #8]\n\tldr\tx9, [sp, #16]\n\tsubs\tx8, x8, x9\n\tcset\tw8, le\n\ttbnz\tw8, #0, LBB0_5\n\tb\tLBB0_4\nLBB0_4: ; in Loop: Header=BB0_1 Depth=1\n\tldr\tx8, [sp, #8]\n\tstr\tx8, [sp, #16]\n\tb\tLBB0_5\nLBB0_5: ; in Loop: Header=BB0_1 Depth=1\n\tb\tLBB0_6\nLBB0_6: ; in Loop: Header=BB0_1 Depth=1\n\tb\tLBB0_1\nLBB0_7:\n\tldur\tx0, [x29, #-8]\n\tldr\tx1, [sp, #16]\n\tbl\t_lua_pushnumber\n\tmov\tw0, #1\n\n```", "role": "user" }, { "content": "```armasm\n\tldp\tx29, x30, [sp, #32] ; 16-byte Folded Reload\n\tadd\tsp, sp, #48\n\tret\n\t.cfi_endproc\n ; -- End function\n\t.comm\t_LUA_TTABLE,4,2 ; @LUA_TTABLE\n\t.comm\t_LUA_TNUMBER,8,3 ; @LUA_TNUMBER\n\t.no_dead_strip\t_maxn\n.subsections_via_symbols\n```", "role": "assistant" } ]
extr_ssiu.c_rsnd_ssiu_mod_get.c
[ { "content": "You are given an x86 assembly block (<block>) to traspile into armv8_64 assembly.\nYou are also given the context for this block in the form of pre-context (<pre_context>) and post-context (<post_context>).\nThere is also a pre-target-context (<pre_target>) which is the context for the target block. Use the input pre and post context along with the target pre context to transpile the block from x86 to armv8_64.\n\n```x86asm\n; <pre-context>\n\n; <block>\n\t.text\n\t.file\t\"extr_ssiu.c_rsnd_ssiu_mod_get.c\"\n\t.p2align\t4, 0x90 # -- Begin function rsnd_ssiu_mod_get\n\t.type\trsnd_ssiu_mod_get,@function\nrsnd_ssiu_mod_get: # @rsnd_ssiu_mod_get\n\t.cfi_startproc\n# %bb.0:\n\tpushq\t%rbp\n\t.cfi_def_cfa_offset 16\n\t.cfi_offset %rbp, -16\n\tmovq\t%rsp, %rbp\n\t.cfi_def_cfa_register %rbp\n\tsubq\t$32, %rsp\n\tmovq\t%rdi, -8(%rbp)\n\tmovl\t%esi, -12(%rbp)\n\tmovb\t$1, %al\n\tcmpl\t$0, -12(%rbp)\n\tmovb\t%al, -13(%rbp) # 1-byte Spill\n\tjl\t.LBB0_2\n# %bb.1:\n\tmovl\t-12(%rbp), %eax\n\tmovl\t%eax, -20(%rbp) # 4-byte Spill\n\tmovq\t-8(%rbp), %rdi\n\tcallq\trsnd_ssiu_nr@PLT\n\tmovl\t%eax, %ecx\n\tmovl\t-20(%rbp), %eax # 4-byte Reload\n\tcmpl\t%ecx, %eax\n\tsetge\t%al\n\tmovb\t%al, -13(%rbp) # 1-byte Spill\n.LBB0_2:\n\tmovb\t-13(%rbp), %al # 1-byte Reload\n\tandb\t$1, %al\n\tmovzbl\t%al, %edi\n\tcallq\tWARN_ON@PLT\n\tcmpq\t$0, %rax\n\n; <post-context>\n\tje\t.LBB0_4\n# %bb.3:\n\tmovl\t$0, -12(%rbp)\n.LBB0_4:\n\tmovq\t-8(%rbp), %rax\n\tmovq\t(%rax), %rdi\n\tmovslq\t-12(%rbp), %rax\n\tshlq\t$2, %rax\n\taddq\t%rax, %rdi\n\n```\n\n```armasm\n; <pre-target>\n\n```", "role": "user" }, { "content": "```armasm\n\t.section\t__TEXT,__text,regular,pure_instructions\n\t.build_version macos, 13, 0\tsdk_version 13, 3\n\t.p2align\t2 ; -- Begin function rsnd_ssiu_mod_get\n_rsnd_ssiu_mod_get: ; @rsnd_ssiu_mod_get\n\t.cfi_startproc\n; %bb.0:\n\tsub\tsp, sp, #48\n\t.cfi_def_cfa_offset 48\n\tstp\tx29, x30, [sp, #32] ; 16-byte Folded Spill\n\tadd\tx29, sp, #32\n\t.cfi_def_cfa w29, 16\n\t.cfi_offset w30, -8\n\t.cfi_offset w29, -16\n\tstur\tx0, [x29, #-8]\n\tstur\tw1, [x29, #-12]\n\tldur\tw8, [x29, #-12]\n\tsubs\tw8, w8, #0\n\tcset\tw8, lt\n\tmov\tw9, #1\n\tstr\tw9, [sp, #16] ; 4-byte Folded Spill\n\ttbnz\tw8, #0, LBB0_2\n\tb\tLBB0_1\nLBB0_1:\n\tldur\tw8, [x29, #-12]\n\tstr\tw8, [sp, #12] ; 4-byte Folded Spill\n\tldur\tx0, [x29, #-8]\n\tbl\t_rsnd_ssiu_nr\n\tldr\tw8, [sp, #12] ; 4-byte Folded Reload\n\tsubs\tw8, w8, w0\n\tcset\tw8, ge\n\tstr\tw8, [sp, #16] ; 4-byte Folded Spill\n\tb\tLBB0_2\nLBB0_2:\n\tldr\tw8, [sp, #16] ; 4-byte Folded Reload\n\tand\tw0, w8, #0x1\n\tbl\t_WARN_ON\n\tsubs\tx8, x0, #0\n\tcset\tw8, eq\n```", "role": "assistant" } ]
extr_ssiu.c_rsnd_ssiu_mod_get.c
[ { "content": "You are given an x86 assembly block (<block>) to traspile into armv8_64 assembly.\nYou are also given the context for this block in the form of pre-context (<pre_context>) and post-context (<post_context>).\nThere is also a pre-target-context (<pre_target>) which is the context for the target block. Use the input pre and post context along with the target pre context to transpile the block from x86 to armv8_64.\n\n```x86asm\n; <pre-context>\n\tmovq\t-8(%rbp), %rdi\n\tcallq\trsnd_ssiu_nr@PLT\n\tmovl\t%eax, %ecx\n\tmovl\t-20(%rbp), %eax # 4-byte Reload\n\tcmpl\t%ecx, %eax\n\tsetge\t%al\n\tmovb\t%al, -13(%rbp) # 1-byte Spill\n.LBB0_2:\n\tmovb\t-13(%rbp), %al # 1-byte Reload\n\tandb\t$1, %al\n\tmovzbl\t%al, %edi\n\tcallq\tWARN_ON@PLT\n\tcmpq\t$0, %rax\n\n; <block>\n\tje\t.LBB0_4\n# %bb.3:\n\tmovl\t$0, -12(%rbp)\n.LBB0_4:\n\tmovq\t-8(%rbp), %rax\n\tmovq\t(%rax), %rdi\n\tmovslq\t-12(%rbp), %rax\n\tshlq\t$2, %rax\n\taddq\t%rax, %rdi\n\tcallq\trsnd_mod_get@PLT\n\taddq\t$32, %rsp\n\tpopq\t%rbp\n\t.cfi_def_cfa %rsp, 8\n\tretq\n.Lfunc_end0:\n\t.size\trsnd_ssiu_mod_get, .Lfunc_end0-rsnd_ssiu_mod_get\n\t.cfi_endproc\n # -- End function\n\t.ident\t\"Ubuntu clang version 18.1.3 (1ubuntu1)\"\n\t.section\t\".note.GNU-stack\",\"\",@progbits\n\t.addrsig\n\t.addrsig_sym rsnd_ssiu_mod_get\n\t.addrsig_sym WARN_ON\n\t.addrsig_sym rsnd_ssiu_nr\n\t.addrsig_sym rsnd_mod_get\n\n; <post-context>\n\n```\n\n```armasm\n; <pre-target>\n\t.cfi_startproc\n; %bb.0:\n\tsub\tsp, sp, #48\n\t.cfi_def_cfa_offset 48\n\tstp\tx29, x30, [sp, #32] ; 16-byte Folded Spill\n\tadd\tx29, sp, #32\n\t.cfi_def_cfa w29, 16\n\t.cfi_offset w30, -8\n\t.cfi_offset w29, -16\n\tstur\tx0, [x29, #-8]\n\tstur\tw1, [x29, #-12]\n\tldur\tw8, [x29, #-12]\n\tsubs\tw8, w8, #0\n\tcset\tw8, lt\n\tmov\tw9, #1\n\tstr\tw9, [sp, #16] ; 4-byte Folded Spill\n\ttbnz\tw8, #0, LBB0_2\n\tb\tLBB0_1\nLBB0_1:\n\tldur\tw8, [x29, #-12]\n\tstr\tw8, [sp, #12] ; 4-byte Folded Spill\n\tldur\tx0, [x29, #-8]\n\tbl\t_rsnd_ssiu_nr\n\tldr\tw8, [sp, #12] ; 4-byte Folded Reload\n\tsubs\tw8, w8, w0\n\tcset\tw8, ge\n\tstr\tw8, [sp, #16] ; 4-byte Folded Spill\n\tb\tLBB0_2\nLBB0_2:\n\tldr\tw8, [sp, #16] ; 4-byte Folded Reload\n\tand\tw0, w8, #0x1\n\tbl\t_WARN_ON\n\tsubs\tx8, x0, #0\n\tcset\tw8, eq\n\n```", "role": "user" }, { "content": "```armasm\n\ttbnz\tw8, #0, LBB0_4\n\tb\tLBB0_3\nLBB0_3:\n\tstur\twzr, [x29, #-12]\n\tb\tLBB0_4\nLBB0_4:\n\tldur\tx8, [x29, #-8]\n\tldr\tx8, [x8]\n\tldursw\tx9, [x29, #-12]\n\tadd\tx0, x8, x9, lsl #2\n\tbl\t_rsnd_mod_get\n\tldp\tx29, x30, [sp, #32] ; 16-byte Folded Reload\n\tadd\tsp, sp, #48\n\tret\n\t.cfi_endproc\n ; -- End function\n\t.no_dead_strip\t_rsnd_ssiu_mod_get\n.subsections_via_symbols\n```", "role": "assistant" } ]
extr_qlcnic_sysfs.c_qlcnicvf_config_led.c
[ { "content": "You are given an x86 assembly block (<block>) to traspile into armv8_64 assembly.\nYou are also given the context for this block in the form of pre-context (<pre_context>) and post-context (<post_context>).\nThere is also a pre-target-context (<pre_target>) which is the context for the target block. Use the input pre and post context along with the target pre context to transpile the block from x86 to armv8_64.\n\n```x86asm\n; <pre-context>\n\n; <block>\n\t.text\n\t.file\t\"extr_qlcnic_sysfs.c_qlcnicvf_config_led.c\"\n\t.globl\tqlcnicvf_config_led # -- Begin function qlcnicvf_config_led\n\t.p2align\t4, 0x90\n\t.type\tqlcnicvf_config_led,@function\nqlcnicvf_config_led: # @qlcnicvf_config_led\n\t.cfi_startproc\n# %bb.0:\n\tpushq\t%rbp\n\t.cfi_def_cfa_offset 16\n\t.cfi_offset %rbp, -16\n\tmovq\t%rsp, %rbp\n\t.cfi_def_cfa_register %rbp\n\tmovq\t%rdi, -8(%rbp)\n\tmovl\t%esi, -12(%rbp)\n\tmovl\t%edx, -16(%rbp)\n\txorl\t%eax, %eax\n\tsubl\tEOPNOTSUPP(%rip), %eax\n\tpopq\t%rbp\n\t.cfi_def_cfa %rsp, 8\n\tretq\n.Lfunc_end0:\n\t.size\tqlcnicvf_config_led, .Lfunc_end0-qlcnicvf_config_led\n\t.cfi_endproc\n # -- End function\n\t.type\tEOPNOTSUPP,@object # @EOPNOTSUPP\n\t.bss\n\t.globl\tEOPNOTSUPP\n\t.p2align\t2, 0x0\nEOPNOTSUPP:\n\t.long\t0 # 0x0\n\t.size\tEOPNOTSUPP, 4\n\n\t.ident\t\"Ubuntu clang version 18.1.3 (1ubuntu1)\"\n\t.section\t\".note.GNU-stack\",\"\",@progbits\n\t.addrsig\n\t.addrsig_sym EOPNOTSUPP\n\n; <post-context>\n\n```\n\n```armasm\n; <pre-target>\n\n```", "role": "user" }, { "content": "```armasm\n\t.section\t__TEXT,__text,regular,pure_instructions\n\t.build_version macos, 13, 0\tsdk_version 13, 3\n\t.globl\t_qlcnicvf_config_led ; -- Begin function qlcnicvf_config_led\n\t.p2align\t2\n_qlcnicvf_config_led: ; @qlcnicvf_config_led\n\t.cfi_startproc\n; %bb.0:\n\tsub\tsp, sp, #16\n\t.cfi_def_cfa_offset 16\n\tstr\tx0, [sp, #8]\n\tstr\tw1, [sp, #4]\n\tstr\tw2, [sp]\n\tadrp\tx8, _EOPNOTSUPP@GOTPAGE\n\tldr\tx8, [x8, _EOPNOTSUPP@GOTPAGEOFF]\n\tldr\tw9, [x8]\n\tmov\tw8, #0\n\tsubs\tw0, w8, w9\n\tadd\tsp, sp, #16\n\tret\n\t.cfi_endproc\n ; -- End function\n\t.comm\t_EOPNOTSUPP,4,2 ; @EOPNOTSUPP\n.subsections_via_symbols\n```", "role": "assistant" } ]
extr_tap_dance.c_dance_lctl_finished.c
[ { "content": "You are given an x86 assembly block (<block>) to traspile into armv8_64 assembly.\nYou are also given the context for this block in the form of pre-context (<pre_context>) and post-context (<post_context>).\nThere is also a pre-target-context (<pre_target>) which is the context for the target block. Use the input pre and post context along with the target pre context to transpile the block from x86 to armv8_64.\n\n```x86asm\n; <pre-context>\n\n; <block>\n\t.text\n\t.file\t\"extr_tap_dance.c_dance_lctl_finished.c\"\n\t.globl\tdance_lctl_finished # -- Begin function dance_lctl_finished\n\t.p2align\t4, 0x90\n\t.type\tdance_lctl_finished,@function\ndance_lctl_finished: # @dance_lctl_finished\n\t.cfi_startproc\n# %bb.0:\n\tpushq\t%rbp\n\t.cfi_def_cfa_offset 16\n\t.cfi_offset %rbp, -16\n\tmovq\t%rsp, %rbp\n\t.cfi_def_cfa_register %rbp\n\tsubq\t$16, %rsp\n\tmovq\t%rdi, -8(%rbp)\n\tmovq\t%rsi, -16(%rbp)\n\tmovl\tENABLED(%rip), %edx\n\tmovq\trbw_led_keys(%rip), %rax\n\tmovq\tRBW_LCTL(%rip), %rcx\n\tmovl\t%edx, (%rax,%rcx,4)\n\tmovl\tKC_LCTRL(%rip), %edi\n\tcallq\tregister_code@PLT\n\taddq\t$16, %rsp\n\tpopq\t%rbp\n\t.cfi_def_cfa %rsp, 8\n\tretq\n.Lfunc_end0:\n\t.size\tdance_lctl_finished, .Lfunc_end0-dance_lctl_finished\n\t.cfi_endproc\n # -- End function\n\t.type\tENABLED,@object # @ENABLED\n\t.bss\n\t.globl\tENABLED\n\t.p2align\t2, 0x0\nENABLED:\n\t.long\t0 # 0x0\n\t.size\tENABLED, 4\n\n\t.type\trbw_led_keys,@object # @rbw_led_keys\n\t.globl\trbw_led_keys\n\t.p2align\t3, 0x0\nrbw_led_keys:\n\t.quad\t0\n\t.size\trbw_led_keys, 8\n\n\t.type\tRBW_LCTL,@object # @RBW_LCTL\n\t.globl\tRBW_LCTL\n\t.p2align\t3, 0x0\nRBW_LCTL:\n\t.quad\t0 # 0x0\n\t.size\tRBW_LCTL, 8\n\n\t.type\tKC_LCTRL,@object # @KC_LCTRL\n\t.globl\tKC_LCTRL\n\t.p2align\t2, 0x0\nKC_LCTRL:\n\t.long\t0 # 0x0\n\t.size\tKC_LCTRL, 4\n\n\t.ident\t\"Ubuntu clang version 18.1.3 (1ubuntu1)\"\n\t.section\t\".note.GNU-stack\",\"\",@progbits\n\t.addrsig\n\t.addrsig_sym register_code\n\t.addrsig_sym ENABLED\n\t.addrsig_sym rbw_led_keys\n\t.addrsig_sym RBW_LCTL\n\t.addrsig_sym KC_LCTRL\n\n; <post-context>\n\n```\n\n```armasm\n; <pre-target>\n\n```", "role": "user" }, { "content": "```armasm\n\t.section\t__TEXT,__text,regular,pure_instructions\n\t.build_version macos, 13, 0\tsdk_version 13, 3\n\t.globl\t_dance_lctl_finished ; -- Begin function dance_lctl_finished\n\t.p2align\t2\n_dance_lctl_finished: ; @dance_lctl_finished\n\t.cfi_startproc\n; %bb.0:\n\tsub\tsp, sp, #32\n\t.cfi_def_cfa_offset 32\n\tstp\tx29, x30, [sp, #16] ; 16-byte Folded Spill\n\tadd\tx29, sp, #16\n\t.cfi_def_cfa w29, 16\n\t.cfi_offset w30, -8\n\t.cfi_offset w29, -16\n\tstr\tx0, [sp, #8]\n\tstr\tx1, [sp]\n\tadrp\tx8, _ENABLED@GOTPAGE\n\tldr\tx8, [x8, _ENABLED@GOTPAGEOFF]\n\tldr\tw8, [x8]\n\tadrp\tx9, _rbw_led_keys@GOTPAGE\n\tldr\tx9, [x9, _rbw_led_keys@GOTPAGEOFF]\n\tldr\tx9, [x9]\n\tadrp\tx10, _RBW_LCTL@GOTPAGE\n\tldr\tx10, [x10, _RBW_LCTL@GOTPAGEOFF]\n\tldr\tx10, [x10]\n\tstr\tw8, [x9, x10, lsl #2]\n\tadrp\tx8, _KC_LCTRL@GOTPAGE\n\tldr\tx8, [x8, _KC_LCTRL@GOTPAGEOFF]\n\tldr\tw0, [x8]\n\tbl\t_register_code\n\tldp\tx29, x30, [sp, #16] ; 16-byte Folded Reload\n\tadd\tsp, sp, #32\n\tret\n\t.cfi_endproc\n ; -- End function\n\t.comm\t_ENABLED,4,2 ; @ENABLED\n\t.comm\t_rbw_led_keys,8,3 ; @rbw_led_keys\n\t.comm\t_RBW_LCTL,8,3 ; @RBW_LCTL\n\t.comm\t_KC_LCTRL,4,2 ; @KC_LCTRL\n.subsections_via_symbols\n```", "role": "assistant" } ]
extr_npx.c_fpu_kern_thread.c
[ { "content": "You are given an x86 assembly block (<block>) to traspile into armv8_64 assembly.\nYou are also given the context for this block in the form of pre-context (<pre_context>) and post-context (<post_context>).\nThere is also a pre-target-context (<pre_target>) which is the context for the target block. Use the input pre and post context along with the target pre context to transpile the block from x86 to armv8_64.\n\n```x86asm\n; <pre-context>\n\n; <block>\n\t.text\n\t.file\t\"extr_npx.c_fpu_kern_thread.c\"\n\t.globl\tfpu_kern_thread # -- Begin function fpu_kern_thread\n\t.p2align\t4, 0x90\n\t.type\tfpu_kern_thread,@function\nfpu_kern_thread: # @fpu_kern_thread\n\t.cfi_startproc\n# %bb.0:\n\tpushq\t%rbp\n\t.cfi_def_cfa_offset 16\n\t.cfi_offset %rbp, -16\n\tmovq\t%rsp, %rbp\n\t.cfi_def_cfa_register %rbp\n\tsubq\t$16, %rsp\n\tmovl\t%edi, -4(%rbp)\n\tmovq\tcurthread(%rip), %rax\n\tmovl\t(%rax), %eax\n\tandl\tTDP_KTHREAD(%rip), %eax\n\tcmpl\t$0, %eax\n\tsetne\t%al\n\tandb\t$1, %al\n\tmovzbl\t%al, %edi\n\tleaq\t.L.str(%rip), %rsi\n\tcallq\tKASSERT@PLT\n\tmovq\tcurpcb(%rip), %rax\n\tmovq\t(%rax), %rax\n\tmovq\t%rax, -16(%rbp) # 8-byte Spill\n\tmovq\tcurpcb(%rip), %rdi\n\tcallq\tget_pcb_user_save_pcb@PLT\n\tmovq\t%rax, %rcx\n\tmovq\t-16(%rbp), %rax # 8-byte Reload\n\n; <post-context>\n\tcmpq\t%rcx, %rax\n\tsete\t%al\n\tandb\t$1, %al\n\tmovzbl\t%al, %edi\n\tleaq\t.L.str.1(%rip), %rsi\n\tcallq\tKASSERT@PLT\n\tmovq\tcurpcb(%rip), %rdi\n\tcallq\tPCB_USER_FPU@PLT\n\tmovl\t%eax, %edi\n\tleaq\t.L.str.2(%rip), %rsi\n\tcallq\tKASSERT@PLT\n\n```\n\n```armasm\n; <pre-target>\n\n```", "role": "user" }, { "content": "```armasm\n\t.section\t__TEXT,__text,regular,pure_instructions\n\t.build_version macos, 13, 0\tsdk_version 13, 3\n\t.globl\t_fpu_kern_thread ; -- Begin function fpu_kern_thread\n\t.p2align\t2\n_fpu_kern_thread: ; @fpu_kern_thread\n\t.cfi_startproc\n; %bb.0:\n\tsub\tsp, sp, #48\n\t.cfi_def_cfa_offset 48\n\tstp\tx29, x30, [sp, #32] ; 16-byte Folded Spill\n\tadd\tx29, sp, #32\n\t.cfi_def_cfa w29, 16\n\t.cfi_offset w30, -8\n\t.cfi_offset w29, -16\n\tadrp\tx8, _curpcb@GOTPAGE\n\tldr\tx8, [x8, _curpcb@GOTPAGEOFF]\n\tstr\tx8, [sp, #16] ; 8-byte Folded Spill\n\tstur\tw0, [x29, #-4]\n\tadrp\tx8, _curthread@GOTPAGE\n\tldr\tx8, [x8, _curthread@GOTPAGEOFF]\n\tldr\tx8, [x8]\n\tldr\tw8, [x8]\n\tadrp\tx9, _TDP_KTHREAD@GOTPAGE\n\tldr\tx9, [x9, _TDP_KTHREAD@GOTPAGEOFF]\n\tldr\tw9, [x9]\n\tmov\tw10, #0\n\tstur\tw10, [x29, #-8] ; 4-byte Folded Spill\n\tands\tw8, w8, w9\n\tcset\tw8, ne\n\tand\tw0, w8, #0x1\n\tadrp\tx1, l_.str@PAGE\n\tadd\tx1, x1, l_.str@PAGEOFF\n\tbl\t_KASSERT\n\tldr\tx8, [sp, #16] ; 8-byte Folded Reload\n\tldr\tx9, [x8]\n\tldr\tx9, [x9]\n\tstr\tx9, [sp, #8] ; 8-byte Folded Spill\n\tldr\tx0, [x8]\n\tbl\t_get_pcb_user_save_pcb\n\tldr\tx8, [sp, #8] ; 8-byte Folded Reload\n```", "role": "assistant" } ]
extr_npx.c_fpu_kern_thread.c
[ { "content": "You are given an x86 assembly block (<block>) to traspile into armv8_64 assembly.\nYou are also given the context for this block in the form of pre-context (<pre_context>) and post-context (<post_context>).\nThere is also a pre-target-context (<pre_target>) which is the context for the target block. Use the input pre and post context along with the target pre context to transpile the block from x86 to armv8_64.\n\n```x86asm\n; <pre-context>\n\tleaq\t.L.str(%rip), %rsi\n\tcallq\tKASSERT@PLT\n\tmovq\tcurpcb(%rip), %rax\n\tmovq\t(%rax), %rax\n\tmovq\t%rax, -16(%rbp) # 8-byte Spill\n\tmovq\tcurpcb(%rip), %rdi\n\tcallq\tget_pcb_user_save_pcb@PLT\n\tmovq\t%rax, %rcx\n\tmovq\t-16(%rbp), %rax # 8-byte Reload\n\n; <block>\n\tcmpq\t%rcx, %rax\n\tsete\t%al\n\tandb\t$1, %al\n\tmovzbl\t%al, %edi\n\tleaq\t.L.str.1(%rip), %rsi\n\tcallq\tKASSERT@PLT\n\tmovq\tcurpcb(%rip), %rdi\n\tcallq\tPCB_USER_FPU@PLT\n\tmovl\t%eax, %edi\n\tleaq\t.L.str.2(%rip), %rsi\n\tcallq\tKASSERT@PLT\n\tmovl\tPCB_KERNNPX(%rip), %ecx\n\tmovq\tcurpcb(%rip), %rax\n\torl\t8(%rax), %ecx\n\tmovl\t%ecx, 8(%rax)\n\txorl\t%eax, %eax\n\taddq\t$16, %rsp\n\tpopq\t%rbp\n\t.cfi_def_cfa %rsp, 8\n\tretq\n.Lfunc_end0:\n\t.size\tfpu_kern_thread, .Lfunc_end0-fpu_kern_thread\n\t.cfi_endproc\n # -- End function\n\t.type\tcurthread,@object # @curthread\n\t.bss\n\t.globl\tcurthread\n\t.p2align\t3, 0x0\ncurthread:\n\t.quad\t0\n\t.size\tcurthread, 8\n\n\t.type\tTDP_KTHREAD,@object # @TDP_KTHREAD\n\t.globl\tTDP_KTHREAD\n\t.p2align\t2, 0x0\nTDP_KTHREAD:\n\t.long\t0 # 0x0\n\t.size\tTDP_KTHREAD, 4\n\n\t.type\t.L.str,@object # @.str\n\t.section\t.rodata.str1.1,\"aMS\",@progbits,1\n.L.str:\n\t.asciz\t\"Only kthread may use fpu_kern_thread\"\n\t.size\t.L.str, 37\n\n\t.type\tcurpcb,@object # @curpcb\n\t.bss\n\t.globl\tcurpcb\n\t.p2align\t3, 0x0\ncurpcb:\n\t.quad\t0\n\t.size\tcurpcb, 8\n\n\t.type\t.L.str.1,@object # @.str.1\n\t.section\t.rodata.str1.1,\"aMS\",@progbits,1\n.L.str.1:\n\t.asciz\t\"mangled pcb_save\"\n\t.size\t.L.str.1, 17\n\n\t.type\t.L.str.2,@object # @.str.2\n.L.str.2:\n\t.asciz\t\"recursive call\"\n\t.size\t.L.str.2, 15\n\n\t.type\tPCB_KERNNPX,@object # @PCB_KERNNPX\n\t.bss\n\t.globl\tPCB_KERNNPX\n\t.p2align\t2, 0x0\nPCB_KERNNPX:\n\t.long\t0 # 0x0\n\t.size\tPCB_KERNNPX, 4\n\n\t.ident\t\"Ubuntu clang version 18.1.3 (1ubuntu1)\"\n\t.section\t\".note.GNU-stack\",\"\",@progbits\n\t.addrsig\n\t.addrsig_sym KASSERT\n\t.addrsig_sym get_pcb_user_save_pcb\n\t.addrsig_sym PCB_USER_FPU\n\t.addrsig_sym curthread\n\t.addrsig_sym TDP_KTHREAD\n\t.addrsig_sym curpcb\n\t.addrsig_sym PCB_KERNNPX\n\n; <post-context>\n\n```\n\n```armasm\n; <pre-target>\n\t.cfi_startproc\n; %bb.0:\n\tsub\tsp, sp, #48\n\t.cfi_def_cfa_offset 48\n\tstp\tx29, x30, [sp, #32] ; 16-byte Folded Spill\n\tadd\tx29, sp, #32\n\t.cfi_def_cfa w29, 16\n\t.cfi_offset w30, -8\n\t.cfi_offset w29, -16\n\tadrp\tx8, _curpcb@GOTPAGE\n\tldr\tx8, [x8, _curpcb@GOTPAGEOFF]\n\tstr\tx8, [sp, #16] ; 8-byte Folded Spill\n\tstur\tw0, [x29, #-4]\n\tadrp\tx8, _curthread@GOTPAGE\n\tldr\tx8, [x8, _curthread@GOTPAGEOFF]\n\tldr\tx8, [x8]\n\tldr\tw8, [x8]\n\tadrp\tx9, _TDP_KTHREAD@GOTPAGE\n\tldr\tx9, [x9, _TDP_KTHREAD@GOTPAGEOFF]\n\tldr\tw9, [x9]\n\tmov\tw10, #0\n\tstur\tw10, [x29, #-8] ; 4-byte Folded Spill\n\tands\tw8, w8, w9\n\tcset\tw8, ne\n\tand\tw0, w8, #0x1\n\tadrp\tx1, l_.str@PAGE\n\tadd\tx1, x1, l_.str@PAGEOFF\n\tbl\t_KASSERT\n\tldr\tx8, [sp, #16] ; 8-byte Folded Reload\n\tldr\tx9, [x8]\n\tldr\tx9, [x9]\n\tstr\tx9, [sp, #8] ; 8-byte Folded Spill\n\tldr\tx0, [x8]\n\tbl\t_get_pcb_user_save_pcb\n\tldr\tx8, [sp, #8] ; 8-byte Folded Reload\n\n```", "role": "user" }, { "content": "```armasm\n\tsubs\tx8, x8, x0\n\tcset\tw8, eq\n\tand\tw0, w8, #0x1\n\tadrp\tx1, l_.str.1@PAGE\n\tadd\tx1, x1, l_.str.1@PAGEOFF\n\tbl\t_KASSERT\n\tldr\tx8, [sp, #16] ; 8-byte Folded Reload\n\tldr\tx0, [x8]\n\tbl\t_PCB_USER_FPU\n\tadrp\tx1, l_.str.2@PAGE\n\tadd\tx1, x1, l_.str.2@PAGEOFF\n\tbl\t_KASSERT\n\tldr\tx8, [sp, #16] ; 8-byte Folded Reload\n\tldur\tw0, [x29, #-8] ; 4-byte Folded Reload\n\tadrp\tx9, _PCB_KERNNPX@GOTPAGE\n\tldr\tx9, [x9, _PCB_KERNNPX@GOTPAGEOFF]\n\tldr\tw10, [x9]\n\tldr\tx9, [x8]\n\tldr\tw8, [x9, #8]\n\torr\tw8, w8, w10\n\tstr\tw8, [x9, #8]\n\tldp\tx29, x30, [sp, #32] ; 16-byte Folded Reload\n\tadd\tsp, sp, #48\n\tret\n\t.cfi_endproc\n ; -- End function\n\t.comm\t_curthread,8,3 ; @curthread\n\t.comm\t_TDP_KTHREAD,4,2 ; @TDP_KTHREAD\n\t.section\t__TEXT,__cstring,cstring_literals\nl_.str: ; @.str\n\t.asciz\t\"Only kthread may use fpu_kern_thread\"\n\n\t.comm\t_curpcb,8,3 ; @curpcb\nl_.str.1: ; @.str.1\n\t.asciz\t\"mangled pcb_save\"\n\nl_.str.2: ; @.str.2\n\t.asciz\t\"recursive call\"\n\n\t.comm\t_PCB_KERNNPX,4,2 ; @PCB_KERNNPX\n.subsections_via_symbols\n```", "role": "assistant" } ]
extr_ixgbe_common.c_ixgbe_clear_tx_pending.c
[ { "content": "You are given an x86 assembly block (<block>) to traspile into armv8_64 assembly.\nYou are also given the context for this block in the form of pre-context (<pre_context>) and post-context (<post_context>).\nThere is also a pre-target-context (<pre_target>) which is the context for the target block. Use the input pre and post context along with the target pre context to transpile the block from x86 to armv8_64.\n\n```x86asm\n; <pre-context>\n\n; <block>\n\t.text\n\t.file\t\"extr_ixgbe_common.c_ixgbe_clear_tx_pending.c\"\n\t.globl\tixgbe_clear_tx_pending # -- Begin function ixgbe_clear_tx_pending\n\t.p2align\t4, 0x90\n\t.type\tixgbe_clear_tx_pending,@function\nixgbe_clear_tx_pending: # @ixgbe_clear_tx_pending\n\t.cfi_startproc\n# %bb.0:\n\tpushq\t%rbp\n\t.cfi_def_cfa_offset 16\n\t.cfi_offset %rbp, -16\n\tmovq\t%rsp, %rbp\n\t.cfi_def_cfa_register %rbp\n\tsubq\t$48, %rsp\n\tmovq\t%rdi, -8(%rbp)\n\tmovq\t-8(%rbp), %rax\n\tmovl\t4(%rax), %eax\n\tandl\tIXGBE_FLAGS_DOUBLE_RESET_REQUIRED(%rip), %eax\n\tcmpl\t$0, %eax\n\tjne\t.LBB0_2\n# %bb.1:\n\tjmp\t.LBB0_11\n.LBB0_2:\n\tmovq\t-8(%rbp), %rdi\n\tmovl\tIXGBE_HLREG0(%rip), %esi\n\tcallq\tIXGBE_READ_REG@PLT\n\n; <post-context>\n\tmovq\t%rax, -24(%rbp)\n\tmovq\t-8(%rbp), %rdi\n\tmovl\tIXGBE_HLREG0(%rip), %esi\n\tmovq\t-24(%rbp), %rdx\n\torq\tIXGBE_HLREG0_LPBK(%rip), %rdx\n\n```\n\n```armasm\n; <pre-target>\n\n```", "role": "user" }, { "content": "```armasm\n\t.section\t__TEXT,__text,regular,pure_instructions\n\t.build_version macos, 13, 0\tsdk_version 13, 3\n\t.globl\t_ixgbe_clear_tx_pending ; -- Begin function ixgbe_clear_tx_pending\n\t.p2align\t2\n_ixgbe_clear_tx_pending: ; @ixgbe_clear_tx_pending\n\t.cfi_startproc\n; %bb.0:\n\tsub\tsp, sp, #80\n\t.cfi_def_cfa_offset 80\n\tstp\tx29, x30, [sp, #64] ; 16-byte Folded Spill\n\tadd\tx29, sp, #64\n\t.cfi_def_cfa w29, 16\n\t.cfi_offset w30, -8\n\t.cfi_offset w29, -16\n\tadrp\tx8, _IXGBE_HLREG0@GOTPAGE\n\tldr\tx8, [x8, _IXGBE_HLREG0@GOTPAGEOFF]\n\tstr\tx8, [sp] ; 8-byte Folded Spill\n\tadrp\tx8, _IXGBE_GCR_EXT@GOTPAGE\n\tldr\tx8, [x8, _IXGBE_GCR_EXT@GOTPAGEOFF]\n\tstr\tx8, [sp, #8] ; 8-byte Folded Spill\n\tstur\tx0, [x29, #-8]\n\tldur\tx8, [x29, #-8]\n\tldr\tw8, [x8, #4]\n\tadrp\tx9, _IXGBE_FLAGS_DOUBLE_RESET_REQUIRED@GOTPAGE\n\tldr\tx9, [x9, _IXGBE_FLAGS_DOUBLE_RESET_REQUIRED@GOTPAGEOFF]\n\tldr\tw9, [x9]\n\tands\tw8, w8, w9\n\tcset\tw8, ne\n\ttbnz\tw8, #0, LBB0_2\n\tb\tLBB0_1\nLBB0_1:\n\tb\tLBB0_11\nLBB0_2:\n\tldr\tx8, [sp] ; 8-byte Folded Reload\n\tldur\tx0, [x29, #-8]\n\tldr\tw1, [x8]\n\tbl\t_IXGBE_READ_REG\n\tldr\tx8, [sp] ; 8-byte Folded Reload\n```", "role": "assistant" } ]
extr_ixgbe_common.c_ixgbe_clear_tx_pending.c
[ { "content": "You are given an x86 assembly block (<block>) to traspile into armv8_64 assembly.\nYou are also given the context for this block in the form of pre-context (<pre_context>) and post-context (<post_context>).\nThere is also a pre-target-context (<pre_target>) which is the context for the target block. Use the input pre and post context along with the target pre context to transpile the block from x86 to armv8_64.\n\n```x86asm\n; <pre-context>\n\tjne\t.LBB0_2\n# %bb.1:\n\tjmp\t.LBB0_11\n.LBB0_2:\n\tmovq\t-8(%rbp), %rdi\n\tmovl\tIXGBE_HLREG0(%rip), %esi\n\tcallq\tIXGBE_READ_REG@PLT\n\n; <block>\n\tmovq\t%rax, -24(%rbp)\n\tmovq\t-8(%rbp), %rdi\n\tmovl\tIXGBE_HLREG0(%rip), %esi\n\tmovq\t-24(%rbp), %rdx\n\torq\tIXGBE_HLREG0_LPBK(%rip), %rdx\n\tcallq\tIXGBE_WRITE_REG@PLT\n\tmovq\t-8(%rbp), %rdi\n\tcallq\tIXGBE_WRITE_FLUSH@PLT\n\tmovl\t$3000, %edi # imm = 0xBB8\n\tmovl\t$6000, %esi # imm = 0x1770\n\tcallq\tusleep_range@PLT\n\tmovq\t-8(%rbp), %rdi\n\n; <post-context>\n\tcallq\tixgbe_pcie_timeout_poll@PLT\n\tmovq\t%rax, -40(%rbp)\n\tmovq\t$0, -32(%rbp)\n.LBB0_3: # =>This Inner Loop Header: Depth=1\n\tmovq\t-32(%rbp), %rax\n\tcmpq\t-40(%rbp), %rax\n\n```\n\n```armasm\n; <pre-target>\n\t.cfi_startproc\n; %bb.0:\n\tsub\tsp, sp, #80\n\t.cfi_def_cfa_offset 80\n\tstp\tx29, x30, [sp, #64] ; 16-byte Folded Spill\n\tadd\tx29, sp, #64\n\t.cfi_def_cfa w29, 16\n\t.cfi_offset w30, -8\n\t.cfi_offset w29, -16\n\tadrp\tx8, _IXGBE_HLREG0@GOTPAGE\n\tldr\tx8, [x8, _IXGBE_HLREG0@GOTPAGEOFF]\n\tstr\tx8, [sp] ; 8-byte Folded Spill\n\tadrp\tx8, _IXGBE_GCR_EXT@GOTPAGE\n\tldr\tx8, [x8, _IXGBE_GCR_EXT@GOTPAGEOFF]\n\tstr\tx8, [sp, #8] ; 8-byte Folded Spill\n\tstur\tx0, [x29, #-8]\n\tldur\tx8, [x29, #-8]\n\tldr\tw8, [x8, #4]\n\tadrp\tx9, _IXGBE_FLAGS_DOUBLE_RESET_REQUIRED@GOTPAGE\n\tldr\tx9, [x9, _IXGBE_FLAGS_DOUBLE_RESET_REQUIRED@GOTPAGEOFF]\n\tldr\tw9, [x9]\n\tands\tw8, w8, w9\n\tcset\tw8, ne\n\ttbnz\tw8, #0, LBB0_2\n\tb\tLBB0_1\nLBB0_1:\n\tb\tLBB0_11\nLBB0_2:\n\tldr\tx8, [sp] ; 8-byte Folded Reload\n\tldur\tx0, [x29, #-8]\n\tldr\tw1, [x8]\n\tbl\t_IXGBE_READ_REG\n\tldr\tx8, [sp] ; 8-byte Folded Reload\n\n```", "role": "user" }, { "content": "```armasm\n\tstur\tx0, [x29, #-24]\n\tldur\tx0, [x29, #-8]\n\tldr\tw1, [x8]\n\tldur\tx8, [x29, #-24]\n\tadrp\tx9, _IXGBE_HLREG0_LPBK@GOTPAGE\n\tldr\tx9, [x9, _IXGBE_HLREG0_LPBK@GOTPAGEOFF]\n\tldr\tx9, [x9]\n\torr\tx2, x8, x9\n\tbl\t_IXGBE_WRITE_REG\n\tldur\tx0, [x29, #-8]\n\tbl\t_IXGBE_WRITE_FLUSH\n\tmov\tw0, #3000\n\tmov\tw1, #6000\n\tbl\t_usleep_range\n\tldur\tx0, [x29, #-8]\n```", "role": "assistant" } ]
extr_ixgbe_common.c_ixgbe_clear_tx_pending.c
[ { "content": "You are given an x86 assembly block (<block>) to traspile into armv8_64 assembly.\nYou are also given the context for this block in the form of pre-context (<pre_context>) and post-context (<post_context>).\nThere is also a pre-target-context (<pre_target>) which is the context for the target block. Use the input pre and post context along with the target pre context to transpile the block from x86 to armv8_64.\n\n```x86asm\n; <pre-context>\n\tcallq\tIXGBE_WRITE_REG@PLT\n\tmovq\t-8(%rbp), %rdi\n\tcallq\tIXGBE_WRITE_FLUSH@PLT\n\tmovl\t$3000, %edi # imm = 0xBB8\n\tmovl\t$6000, %esi # imm = 0x1770\n\tcallq\tusleep_range@PLT\n\tmovq\t-8(%rbp), %rdi\n\n; <block>\n\tcallq\tixgbe_pcie_timeout_poll@PLT\n\tmovq\t%rax, -40(%rbp)\n\tmovq\t$0, -32(%rbp)\n.LBB0_3: # =>This Inner Loop Header: Depth=1\n\tmovq\t-32(%rbp), %rax\n\tcmpq\t-40(%rbp), %rax\n\tjge\t.LBB0_10\n# %bb.4: # in Loop: Header=BB0_3 Depth=1\n\tmovl\t$100, %edi\n\tmovl\t$200, %esi\n\tcallq\tusleep_range@PLT\n\tmovq\t-8(%rbp), %rdi\n\tmovl\tIXGBE_PCI_DEVICE_STATUS(%rip), %esi\n\tcallq\tixgbe_read_pci_cfg_word@PLT\n\n; <post-context>\n\tmovl\t%eax, -44(%rbp)\n\tmovq\t-8(%rbp), %rax\n\tmovl\t(%rax), %edi\n\tcallq\tixgbe_removed@PLT\n\tcmpq\t$0, %rax\n\tje\t.LBB0_6\n# %bb.5:\n\n```\n\n```armasm\n; <pre-target>\n\t.cfi_startproc\n; %bb.0:\n\tsub\tsp, sp, #80\n\t.cfi_def_cfa_offset 80\n\tstp\tx29, x30, [sp, #64] ; 16-byte Folded Spill\n\tadd\tx29, sp, #64\n\t.cfi_def_cfa w29, 16\n\t.cfi_offset w30, -8\n\t.cfi_offset w29, -16\n\tadrp\tx8, _IXGBE_HLREG0@GOTPAGE\n\tldr\tx8, [x8, _IXGBE_HLREG0@GOTPAGEOFF]\n\tstr\tx8, [sp] ; 8-byte Folded Spill\n\tadrp\tx8, _IXGBE_GCR_EXT@GOTPAGE\n\tldr\tx8, [x8, _IXGBE_GCR_EXT@GOTPAGEOFF]\n\tstr\tx8, [sp, #8] ; 8-byte Folded Spill\n\tstur\tx0, [x29, #-8]\n\tldur\tx8, [x29, #-8]\n\tldr\tw8, [x8, #4]\n\tadrp\tx9, _IXGBE_FLAGS_DOUBLE_RESET_REQUIRED@GOTPAGE\n\tldr\tx9, [x9, _IXGBE_FLAGS_DOUBLE_RESET_REQUIRED@GOTPAGEOFF]\n\tldr\tw9, [x9]\n\tands\tw8, w8, w9\n\tcset\tw8, ne\n\ttbnz\tw8, #0, LBB0_2\n\tb\tLBB0_1\nLBB0_1:\n\tb\tLBB0_11\nLBB0_2:\n\tldr\tx8, [sp] ; 8-byte Folded Reload\n\tldur\tx0, [x29, #-8]\n\tldr\tw1, [x8]\n\tbl\t_IXGBE_READ_REG\n\tldr\tx8, [sp] ; 8-byte Folded Reload\n\tstur\tx0, [x29, #-24]\n\tldur\tx0, [x29, #-8]\n\tldr\tw1, [x8]\n\tldur\tx8, [x29, #-24]\n\tadrp\tx9, _IXGBE_HLREG0_LPBK@GOTPAGE\n\tldr\tx9, [x9, _IXGBE_HLREG0_LPBK@GOTPAGEOFF]\n\tldr\tx9, [x9]\n\torr\tx2, x8, x9\n\tbl\t_IXGBE_WRITE_REG\n\tldur\tx0, [x29, #-8]\n\tbl\t_IXGBE_WRITE_FLUSH\n\tmov\tw0, #3000\n\tmov\tw1, #6000\n\tbl\t_usleep_range\n\tldur\tx0, [x29, #-8]\n\n```", "role": "user" }, { "content": "```armasm\n\tbl\t_ixgbe_pcie_timeout_poll\n\tstr\tx0, [sp, #24]\n\tstr\txzr, [sp, #32]\n\tb\tLBB0_3\nLBB0_3: ; =>This Inner Loop Header: Depth=1\n\tldr\tx8, [sp, #32]\n\tldr\tx9, [sp, #24]\n\tsubs\tx8, x8, x9\n\tcset\tw8, ge\n\ttbnz\tw8, #0, LBB0_10\n\tb\tLBB0_4\nLBB0_4: ; in Loop: Header=BB0_3 Depth=1\n\tmov\tw0, #100\n\tmov\tw1, #200\n\tbl\t_usleep_range\n\tldur\tx0, [x29, #-8]\n\tadrp\tx8, _IXGBE_PCI_DEVICE_STATUS@GOTPAGE\n\tldr\tx8, [x8, _IXGBE_PCI_DEVICE_STATUS@GOTPAGEOFF]\n\tldr\tw1, [x8]\n\tbl\t_ixgbe_read_pci_cfg_word\n```", "role": "assistant" } ]
extr_ixgbe_common.c_ixgbe_clear_tx_pending.c
[ { "content": "You are given an x86 assembly block (<block>) to traspile into armv8_64 assembly.\nYou are also given the context for this block in the form of pre-context (<pre_context>) and post-context (<post_context>).\nThere is also a pre-target-context (<pre_target>) which is the context for the target block. Use the input pre and post context along with the target pre context to transpile the block from x86 to armv8_64.\n\n```x86asm\n; <pre-context>\n\tjge\t.LBB0_10\n# %bb.4: # in Loop: Header=BB0_3 Depth=1\n\tmovl\t$100, %edi\n\tmovl\t$200, %esi\n\tcallq\tusleep_range@PLT\n\tmovq\t-8(%rbp), %rdi\n\tmovl\tIXGBE_PCI_DEVICE_STATUS(%rip), %esi\n\tcallq\tixgbe_read_pci_cfg_word@PLT\n\n; <block>\n\tmovl\t%eax, -44(%rbp)\n\tmovq\t-8(%rbp), %rax\n\tmovl\t(%rax), %edi\n\tcallq\tixgbe_removed@PLT\n\tcmpq\t$0, %rax\n\tje\t.LBB0_6\n# %bb.5:\n\tjmp\t.LBB0_10\n.LBB0_6: # in Loop: Header=BB0_3 Depth=1\n\tmovl\t-44(%rbp), %eax\n\tandl\tIXGBE_PCI_DEVICE_STATUS_TRANSACTION_PENDING(%rip), %eax\n\tcmpl\t$0, %eax\n\tjne\t.LBB0_8\n# %bb.7:\n\tjmp\t.LBB0_10\n.LBB0_8: # in Loop: Header=BB0_3 Depth=1\n\n; <post-context>\n\tjmp\t.LBB0_9\n.LBB0_9: # in Loop: Header=BB0_3 Depth=1\n\tmovq\t-32(%rbp), %rax\n\taddq\t$1, %rax\n\tmovq\t%rax, -32(%rbp)\n\tjmp\t.LBB0_3\n.LBB0_10:\n\tmovq\t-8(%rbp), %rdi\n\tmovl\tIXGBE_GCR_EXT(%rip), %esi\n\n```\n\n```armasm\n; <pre-target>\n\t.cfi_startproc\n; %bb.0:\n\tsub\tsp, sp, #80\n\t.cfi_def_cfa_offset 80\n\tstp\tx29, x30, [sp, #64] ; 16-byte Folded Spill\n\tadd\tx29, sp, #64\n\t.cfi_def_cfa w29, 16\n\t.cfi_offset w30, -8\n\t.cfi_offset w29, -16\n\tadrp\tx8, _IXGBE_HLREG0@GOTPAGE\n\tldr\tx8, [x8, _IXGBE_HLREG0@GOTPAGEOFF]\n\tstr\tx8, [sp] ; 8-byte Folded Spill\n\tadrp\tx8, _IXGBE_GCR_EXT@GOTPAGE\n\tldr\tx8, [x8, _IXGBE_GCR_EXT@GOTPAGEOFF]\n\tstr\tx8, [sp, #8] ; 8-byte Folded Spill\n\tstur\tx0, [x29, #-8]\n\tldur\tx8, [x29, #-8]\n\tldr\tw8, [x8, #4]\n\tadrp\tx9, _IXGBE_FLAGS_DOUBLE_RESET_REQUIRED@GOTPAGE\n\tldr\tx9, [x9, _IXGBE_FLAGS_DOUBLE_RESET_REQUIRED@GOTPAGEOFF]\n\tldr\tw9, [x9]\n\tands\tw8, w8, w9\n\tcset\tw8, ne\n\ttbnz\tw8, #0, LBB0_2\n\tb\tLBB0_1\nLBB0_1:\n\tb\tLBB0_11\nLBB0_2:\n\tldr\tx8, [sp] ; 8-byte Folded Reload\n\tldur\tx0, [x29, #-8]\n\tldr\tw1, [x8]\n\tbl\t_IXGBE_READ_REG\n\tldr\tx8, [sp] ; 8-byte Folded Reload\n\tstur\tx0, [x29, #-24]\n\tldur\tx0, [x29, #-8]\n\tldr\tw1, [x8]\n\tldur\tx8, [x29, #-24]\n\tadrp\tx9, _IXGBE_HLREG0_LPBK@GOTPAGE\n\tldr\tx9, [x9, _IXGBE_HLREG0_LPBK@GOTPAGEOFF]\n\tldr\tx9, [x9]\n\torr\tx2, x8, x9\n\tbl\t_IXGBE_WRITE_REG\n\tldur\tx0, [x29, #-8]\n\tbl\t_IXGBE_WRITE_FLUSH\n\tmov\tw0, #3000\n\tmov\tw1, #6000\n\tbl\t_usleep_range\n\tldur\tx0, [x29, #-8]\n\tbl\t_ixgbe_pcie_timeout_poll\n\tstr\tx0, [sp, #24]\n\tstr\txzr, [sp, #32]\n\tb\tLBB0_3\nLBB0_3: ; =>This Inner Loop Header: Depth=1\n\tldr\tx8, [sp, #32]\n\tldr\tx9, [sp, #24]\n\tsubs\tx8, x8, x9\n\tcset\tw8, ge\n\ttbnz\tw8, #0, LBB0_10\n\tb\tLBB0_4\nLBB0_4: ; in Loop: Header=BB0_3 Depth=1\n\tmov\tw0, #100\n\tmov\tw1, #200\n\tbl\t_usleep_range\n\tldur\tx0, [x29, #-8]\n\tadrp\tx8, _IXGBE_PCI_DEVICE_STATUS@GOTPAGE\n\tldr\tx8, [x8, _IXGBE_PCI_DEVICE_STATUS@GOTPAGEOFF]\n\tldr\tw1, [x8]\n\tbl\t_ixgbe_read_pci_cfg_word\n\n```", "role": "user" }, { "content": "```armasm\n\tstr\tw0, [sp, #20]\n\tldur\tx8, [x29, #-8]\n\tldr\tw0, [x8]\n\tbl\t_ixgbe_removed\n\tsubs\tx8, x0, #0\n\tcset\tw8, eq\n\ttbnz\tw8, #0, LBB0_6\n\tb\tLBB0_5\nLBB0_5:\n\tb\tLBB0_10\nLBB0_6: ; in Loop: Header=BB0_3 Depth=1\n\tldr\tw8, [sp, #20]\n\tadrp\tx9, _IXGBE_PCI_DEVICE_STATUS_TRANSACTION_PENDING@GOTPAGE\n\tldr\tx9, [x9, _IXGBE_PCI_DEVICE_STATUS_TRANSACTION_PENDING@GOTPAGEOFF]\n\tldr\tw9, [x9]\n\tands\tw8, w8, w9\n\tcset\tw8, ne\n\ttbnz\tw8, #0, LBB0_8\n\tb\tLBB0_7\nLBB0_7:\n\tb\tLBB0_10\nLBB0_8: ; in Loop: Header=BB0_3 Depth=1\n```", "role": "assistant" } ]
extr_ixgbe_common.c_ixgbe_clear_tx_pending.c
[ { "content": "You are given an x86 assembly block (<block>) to traspile into armv8_64 assembly.\nYou are also given the context for this block in the form of pre-context (<pre_context>) and post-context (<post_context>).\nThere is also a pre-target-context (<pre_target>) which is the context for the target block. Use the input pre and post context along with the target pre context to transpile the block from x86 to armv8_64.\n\n```x86asm\n; <pre-context>\n\tjmp\t.LBB0_10\n.LBB0_6: # in Loop: Header=BB0_3 Depth=1\n\tmovl\t-44(%rbp), %eax\n\tandl\tIXGBE_PCI_DEVICE_STATUS_TRANSACTION_PENDING(%rip), %eax\n\tcmpl\t$0, %eax\n\tjne\t.LBB0_8\n# %bb.7:\n\tjmp\t.LBB0_10\n.LBB0_8: # in Loop: Header=BB0_3 Depth=1\n\n; <block>\n\tjmp\t.LBB0_9\n.LBB0_9: # in Loop: Header=BB0_3 Depth=1\n\tmovq\t-32(%rbp), %rax\n\taddq\t$1, %rax\n\tmovq\t%rax, -32(%rbp)\n\tjmp\t.LBB0_3\n.LBB0_10:\n\tmovq\t-8(%rbp), %rdi\n\tmovl\tIXGBE_GCR_EXT(%rip), %esi\n\tcallq\tIXGBE_READ_REG@PLT\n\tmovq\t%rax, -16(%rbp)\n\tmovq\t-8(%rbp), %rdi\n\tmovl\tIXGBE_GCR_EXT(%rip), %esi\n\tmovq\t-16(%rbp), %rdx\n\n; <post-context>\n\torq\tIXGBE_GCR_EXT_BUFFERS_CLEAR(%rip), %rdx\n\tcallq\tIXGBE_WRITE_REG@PLT\n\tmovq\t-8(%rbp), %rdi\n\tcallq\tIXGBE_WRITE_FLUSH@PLT\n\tmovl\t$20, %edi\n\tcallq\tudelay@PLT\n\n```\n\n```armasm\n; <pre-target>\n\t.cfi_startproc\n; %bb.0:\n\tsub\tsp, sp, #80\n\t.cfi_def_cfa_offset 80\n\tstp\tx29, x30, [sp, #64] ; 16-byte Folded Spill\n\tadd\tx29, sp, #64\n\t.cfi_def_cfa w29, 16\n\t.cfi_offset w30, -8\n\t.cfi_offset w29, -16\n\tadrp\tx8, _IXGBE_HLREG0@GOTPAGE\n\tldr\tx8, [x8, _IXGBE_HLREG0@GOTPAGEOFF]\n\tstr\tx8, [sp] ; 8-byte Folded Spill\n\tadrp\tx8, _IXGBE_GCR_EXT@GOTPAGE\n\tldr\tx8, [x8, _IXGBE_GCR_EXT@GOTPAGEOFF]\n\tstr\tx8, [sp, #8] ; 8-byte Folded Spill\n\tstur\tx0, [x29, #-8]\n\tldur\tx8, [x29, #-8]\n\tldr\tw8, [x8, #4]\n\tadrp\tx9, _IXGBE_FLAGS_DOUBLE_RESET_REQUIRED@GOTPAGE\n\tldr\tx9, [x9, _IXGBE_FLAGS_DOUBLE_RESET_REQUIRED@GOTPAGEOFF]\n\tldr\tw9, [x9]\n\tands\tw8, w8, w9\n\tcset\tw8, ne\n\ttbnz\tw8, #0, LBB0_2\n\tb\tLBB0_1\nLBB0_1:\n\tb\tLBB0_11\nLBB0_2:\n\tldr\tx8, [sp] ; 8-byte Folded Reload\n\tldur\tx0, [x29, #-8]\n\tldr\tw1, [x8]\n\tbl\t_IXGBE_READ_REG\n\tldr\tx8, [sp] ; 8-byte Folded Reload\n\tstur\tx0, [x29, #-24]\n\tldur\tx0, [x29, #-8]\n\tldr\tw1, [x8]\n\tldur\tx8, [x29, #-24]\n\tadrp\tx9, _IXGBE_HLREG0_LPBK@GOTPAGE\n\tldr\tx9, [x9, _IXGBE_HLREG0_LPBK@GOTPAGEOFF]\n\tldr\tx9, [x9]\n\torr\tx2, x8, x9\n\tbl\t_IXGBE_WRITE_REG\n\tldur\tx0, [x29, #-8]\n\tbl\t_IXGBE_WRITE_FLUSH\n\tmov\tw0, #3000\n\tmov\tw1, #6000\n\tbl\t_usleep_range\n\tldur\tx0, [x29, #-8]\n\tbl\t_ixgbe_pcie_timeout_poll\n\tstr\tx0, [sp, #24]\n\tstr\txzr, [sp, #32]\n\tb\tLBB0_3\nLBB0_3: ; =>This Inner Loop Header: Depth=1\n\tldr\tx8, [sp, #32]\n\tldr\tx9, [sp, #24]\n\tsubs\tx8, x8, x9\n\tcset\tw8, ge\n\ttbnz\tw8, #0, LBB0_10\n\tb\tLBB0_4\nLBB0_4: ; in Loop: Header=BB0_3 Depth=1\n\tmov\tw0, #100\n\tmov\tw1, #200\n\tbl\t_usleep_range\n\tldur\tx0, [x29, #-8]\n\tadrp\tx8, _IXGBE_PCI_DEVICE_STATUS@GOTPAGE\n\tldr\tx8, [x8, _IXGBE_PCI_DEVICE_STATUS@GOTPAGEOFF]\n\tldr\tw1, [x8]\n\tbl\t_ixgbe_read_pci_cfg_word\n\tstr\tw0, [sp, #20]\n\tldur\tx8, [x29, #-8]\n\tldr\tw0, [x8]\n\tbl\t_ixgbe_removed\n\tsubs\tx8, x0, #0\n\tcset\tw8, eq\n\ttbnz\tw8, #0, LBB0_6\n\tb\tLBB0_5\nLBB0_5:\n\tb\tLBB0_10\nLBB0_6: ; in Loop: Header=BB0_3 Depth=1\n\tldr\tw8, [sp, #20]\n\tadrp\tx9, _IXGBE_PCI_DEVICE_STATUS_TRANSACTION_PENDING@GOTPAGE\n\tldr\tx9, [x9, _IXGBE_PCI_DEVICE_STATUS_TRANSACTION_PENDING@GOTPAGEOFF]\n\tldr\tw9, [x9]\n\tands\tw8, w8, w9\n\tcset\tw8, ne\n\ttbnz\tw8, #0, LBB0_8\n\tb\tLBB0_7\nLBB0_7:\n\tb\tLBB0_10\nLBB0_8: ; in Loop: Header=BB0_3 Depth=1\n\n```", "role": "user" }, { "content": "```armasm\n\tb\tLBB0_9\nLBB0_9: ; in Loop: Header=BB0_3 Depth=1\n\tldr\tx8, [sp, #32]\n\tadd\tx8, x8, #1\n\tstr\tx8, [sp, #32]\n\tb\tLBB0_3\nLBB0_10:\n\tldr\tx8, [sp, #8] ; 8-byte Folded Reload\n\tldur\tx0, [x29, #-8]\n\tldr\tw1, [x8]\n\tbl\t_IXGBE_READ_REG\n\tldr\tx8, [sp, #8] ; 8-byte Folded Reload\n\tstur\tx0, [x29, #-16]\n\tldur\tx0, [x29, #-8]\n\tldr\tw1, [x8]\n\tldur\tx8, [x29, #-16]\n\tadrp\tx9, _IXGBE_GCR_EXT_BUFFERS_CLEAR@GOTPAGE\n\tldr\tx9, [x9, _IXGBE_GCR_EXT_BUFFERS_CLEAR@GOTPAGEOFF]\n\tldr\tx9, [x9]\n```", "role": "assistant" } ]
extr_ixgbe_common.c_ixgbe_clear_tx_pending.c
[ { "content": "You are given an x86 assembly block (<block>) to traspile into armv8_64 assembly.\nYou are also given the context for this block in the form of pre-context (<pre_context>) and post-context (<post_context>).\nThere is also a pre-target-context (<pre_target>) which is the context for the target block. Use the input pre and post context along with the target pre context to transpile the block from x86 to armv8_64.\n\n```x86asm\n; <pre-context>\n\tcallq\tIXGBE_READ_REG@PLT\n\tmovq\t%rax, -16(%rbp)\n\tmovq\t-8(%rbp), %rdi\n\tmovl\tIXGBE_GCR_EXT(%rip), %esi\n\tmovq\t-16(%rbp), %rdx\n\n; <block>\n\torq\tIXGBE_GCR_EXT_BUFFERS_CLEAR(%rip), %rdx\n\tcallq\tIXGBE_WRITE_REG@PLT\n\tmovq\t-8(%rbp), %rdi\n\tcallq\tIXGBE_WRITE_FLUSH@PLT\n\tmovl\t$20, %edi\n\tcallq\tudelay@PLT\n\tmovq\t-8(%rbp), %rdi\n\tmovl\tIXGBE_GCR_EXT(%rip), %esi\n\tmovq\t-16(%rbp), %rdx\n\tcallq\tIXGBE_WRITE_REG@PLT\n\tmovq\t-8(%rbp), %rdi\n\n; <post-context>\n\tmovl\tIXGBE_HLREG0(%rip), %esi\n\tmovq\t-24(%rbp), %rdx\n\tcallq\tIXGBE_WRITE_REG@PLT\n.LBB0_11:\n\taddq\t$48, %rsp\n\tpopq\t%rbp\n\t.cfi_def_cfa %rsp, 8\n\tretq\n.Lfunc_end0:\n\t.size\tixgbe_clear_tx_pending, .Lfunc_end0-ixgbe_clear_tx_pending\n\t.cfi_endproc\n # -- End function\n\t.type\tIXGBE_FLAGS_DOUBLE_RESET_REQUIRED,@object # @IXGBE_FLAGS_DOUBLE_RESET_REQUIRED\n\t.bss\n\t.globl\tIXGBE_FLAGS_DOUBLE_RESET_REQUIRED\n\t.p2align\t2, 0x0\nIXGBE_FLAGS_DOUBLE_RESET_REQUIRED:\n\t.long\t0 # 0x0\n\t.size\tIXGBE_FLAGS_DOUBLE_RESET_REQUIRED, 4\n\n\t.type\tIXGBE_HLREG0,@object # @IXGBE_HLREG0\n\t.globl\tIXGBE_HLREG0\n\t.p2align\t2, 0x0\nIXGBE_HLREG0:\n\t.long\t0 # 0x0\n\t.size\tIXGBE_HLREG0, 4\n\n\t.type\tIXGBE_HLREG0_LPBK,@object # @IXGBE_HLREG0_LPBK\n\t.globl\tIXGBE_HLREG0_LPBK\n\t.p2align\t3, 0x0\nIXGBE_HLREG0_LPBK:\n\t.quad\t0 # 0x0\n\t.size\tIXGBE_HLREG0_LPBK, 8\n\n\t.type\tIXGBE_PCI_DEVICE_STATUS,@object # @IXGBE_PCI_DEVICE_STATUS\n\t.globl\tIXGBE_PCI_DEVICE_STATUS\n\t.p2align\t2, 0x0\nIXGBE_PCI_DEVICE_STATUS:\n\t.long\t0 # 0x0\n\t.size\tIXGBE_PCI_DEVICE_STATUS, 4\n\n\t.type\tIXGBE_PCI_DEVICE_STATUS_TRANSACTION_PENDING,@object # @IXGBE_PCI_DEVICE_STATUS_TRANSACTION_PENDING\n\t.globl\tIXGBE_PCI_DEVICE_STATUS_TRANSACTION_PENDING\n\t.p2align\t2, 0x0\nIXGBE_PCI_DEVICE_STATUS_TRANSACTION_PENDING:\n\t.long\t0 # 0x0\n\t.size\tIXGBE_PCI_DEVICE_STATUS_TRANSACTION_PENDING, 4\n\n\t.type\tIXGBE_GCR_EXT,@object # @IXGBE_GCR_EXT\n\t.globl\tIXGBE_GCR_EXT\n\t.p2align\t2, 0x0\nIXGBE_GCR_EXT:\n\t.long\t0 # 0x0\n\t.size\tIXGBE_GCR_EXT, 4\n\n\t.type\tIXGBE_GCR_EXT_BUFFERS_CLEAR,@object # @IXGBE_GCR_EXT_BUFFERS_CLEAR\n\t.globl\tIXGBE_GCR_EXT_BUFFERS_CLEAR\n\t.p2align\t3, 0x0\nIXGBE_GCR_EXT_BUFFERS_CLEAR:\n\t.quad\t0 # 0x0\n\t.size\tIXGBE_GCR_EXT_BUFFERS_CLEAR, 8\n\n\t.ident\t\"Ubuntu clang version 18.1.3 (1ubuntu1)\"\n\t.section\t\".note.GNU-stack\",\"\",@progbits\n\t.addrsig\n\t.addrsig_sym IXGBE_READ_REG\n\t.addrsig_sym IXGBE_WRITE_REG\n\t.addrsig_sym IXGBE_WRITE_FLUSH\n\t.addrsig_sym usleep_range\n\t.addrsig_sym ixgbe_pcie_timeout_poll\n\t.addrsig_sym ixgbe_read_pci_cfg_word\n\t.addrsig_sym ixgbe_removed\n\t.addrsig_sym udelay\n\t.addrsig_sym IXGBE_FLAGS_DOUBLE_RESET_REQUIRED\n\t.addrsig_sym IXGBE_HLREG0\n\t.addrsig_sym IXGBE_HLREG0_LPBK\n\t.addrsig_sym IXGBE_PCI_DEVICE_STATUS\n\t.addrsig_sym IXGBE_PCI_DEVICE_STATUS_TRANSACTION_PENDING\n\t.addrsig_sym IXGBE_GCR_EXT\n\t.addrsig_sym IXGBE_GCR_EXT_BUFFERS_CLEAR\n\n```\n\n```armasm\n; <pre-target>\n\t.cfi_startproc\n; %bb.0:\n\tsub\tsp, sp, #80\n\t.cfi_def_cfa_offset 80\n\tstp\tx29, x30, [sp, #64] ; 16-byte Folded Spill\n\tadd\tx29, sp, #64\n\t.cfi_def_cfa w29, 16\n\t.cfi_offset w30, -8\n\t.cfi_offset w29, -16\n\tadrp\tx8, _IXGBE_HLREG0@GOTPAGE\n\tldr\tx8, [x8, _IXGBE_HLREG0@GOTPAGEOFF]\n\tstr\tx8, [sp] ; 8-byte Folded Spill\n\tadrp\tx8, _IXGBE_GCR_EXT@GOTPAGE\n\tldr\tx8, [x8, _IXGBE_GCR_EXT@GOTPAGEOFF]\n\tstr\tx8, [sp, #8] ; 8-byte Folded Spill\n\tstur\tx0, [x29, #-8]\n\tldur\tx8, [x29, #-8]\n\tldr\tw8, [x8, #4]\n\tadrp\tx9, _IXGBE_FLAGS_DOUBLE_RESET_REQUIRED@GOTPAGE\n\tldr\tx9, [x9, _IXGBE_FLAGS_DOUBLE_RESET_REQUIRED@GOTPAGEOFF]\n\tldr\tw9, [x9]\n\tands\tw8, w8, w9\n\tcset\tw8, ne\n\ttbnz\tw8, #0, LBB0_2\n\tb\tLBB0_1\nLBB0_1:\n\tb\tLBB0_11\nLBB0_2:\n\tldr\tx8, [sp] ; 8-byte Folded Reload\n\tldur\tx0, [x29, #-8]\n\tldr\tw1, [x8]\n\tbl\t_IXGBE_READ_REG\n\tldr\tx8, [sp] ; 8-byte Folded Reload\n\tstur\tx0, [x29, #-24]\n\tldur\tx0, [x29, #-8]\n\tldr\tw1, [x8]\n\tldur\tx8, [x29, #-24]\n\tadrp\tx9, _IXGBE_HLREG0_LPBK@GOTPAGE\n\tldr\tx9, [x9, _IXGBE_HLREG0_LPBK@GOTPAGEOFF]\n\tldr\tx9, [x9]\n\torr\tx2, x8, x9\n\tbl\t_IXGBE_WRITE_REG\n\tldur\tx0, [x29, #-8]\n\tbl\t_IXGBE_WRITE_FLUSH\n\tmov\tw0, #3000\n\tmov\tw1, #6000\n\tbl\t_usleep_range\n\tldur\tx0, [x29, #-8]\n\tbl\t_ixgbe_pcie_timeout_poll\n\tstr\tx0, [sp, #24]\n\tstr\txzr, [sp, #32]\n\tb\tLBB0_3\nLBB0_3: ; =>This Inner Loop Header: Depth=1\n\tldr\tx8, [sp, #32]\n\tldr\tx9, [sp, #24]\n\tsubs\tx8, x8, x9\n\tcset\tw8, ge\n\ttbnz\tw8, #0, LBB0_10\n\tb\tLBB0_4\nLBB0_4: ; in Loop: Header=BB0_3 Depth=1\n\tmov\tw0, #100\n\tmov\tw1, #200\n\tbl\t_usleep_range\n\tldur\tx0, [x29, #-8]\n\tadrp\tx8, _IXGBE_PCI_DEVICE_STATUS@GOTPAGE\n\tldr\tx8, [x8, _IXGBE_PCI_DEVICE_STATUS@GOTPAGEOFF]\n\tldr\tw1, [x8]\n\tbl\t_ixgbe_read_pci_cfg_word\n\tstr\tw0, [sp, #20]\n\tldur\tx8, [x29, #-8]\n\tldr\tw0, [x8]\n\tbl\t_ixgbe_removed\n\tsubs\tx8, x0, #0\n\tcset\tw8, eq\n\ttbnz\tw8, #0, LBB0_6\n\tb\tLBB0_5\nLBB0_5:\n\tb\tLBB0_10\nLBB0_6: ; in Loop: Header=BB0_3 Depth=1\n\tldr\tw8, [sp, #20]\n\tadrp\tx9, _IXGBE_PCI_DEVICE_STATUS_TRANSACTION_PENDING@GOTPAGE\n\tldr\tx9, [x9, _IXGBE_PCI_DEVICE_STATUS_TRANSACTION_PENDING@GOTPAGEOFF]\n\tldr\tw9, [x9]\n\tands\tw8, w8, w9\n\tcset\tw8, ne\n\ttbnz\tw8, #0, LBB0_8\n\tb\tLBB0_7\nLBB0_7:\n\tb\tLBB0_10\nLBB0_8: ; in Loop: Header=BB0_3 Depth=1\n\tb\tLBB0_9\nLBB0_9: ; in Loop: Header=BB0_3 Depth=1\n\tldr\tx8, [sp, #32]\n\tadd\tx8, x8, #1\n\tstr\tx8, [sp, #32]\n\tb\tLBB0_3\nLBB0_10:\n\tldr\tx8, [sp, #8] ; 8-byte Folded Reload\n\tldur\tx0, [x29, #-8]\n\tldr\tw1, [x8]\n\tbl\t_IXGBE_READ_REG\n\tldr\tx8, [sp, #8] ; 8-byte Folded Reload\n\tstur\tx0, [x29, #-16]\n\tldur\tx0, [x29, #-8]\n\tldr\tw1, [x8]\n\tldur\tx8, [x29, #-16]\n\tadrp\tx9, _IXGBE_GCR_EXT_BUFFERS_CLEAR@GOTPAGE\n\tldr\tx9, [x9, _IXGBE_GCR_EXT_BUFFERS_CLEAR@GOTPAGEOFF]\n\tldr\tx9, [x9]\n\n```", "role": "user" }, { "content": "```armasm\n\torr\tx2, x8, x9\n\tbl\t_IXGBE_WRITE_REG\n\tldur\tx0, [x29, #-8]\n\tbl\t_IXGBE_WRITE_FLUSH\n\tmov\tw0, #20\n\tbl\t_udelay\n\tldr\tx8, [sp, #8] ; 8-byte Folded Reload\n\tldur\tx0, [x29, #-8]\n\tldr\tw1, [x8]\n\tldur\tx2, [x29, #-16]\n\tbl\t_IXGBE_WRITE_REG\n\tldr\tx8, [sp] ; 8-byte Folded Reload\n\tldur\tx0, [x29, #-8]\n```", "role": "assistant" } ]
extr_ixgbe_common.c_ixgbe_clear_tx_pending.c
[ { "content": "You are given an x86 assembly block (<block>) to traspile into armv8_64 assembly.\nYou are also given the context for this block in the form of pre-context (<pre_context>) and post-context (<post_context>).\nThere is also a pre-target-context (<pre_target>) which is the context for the target block. Use the input pre and post context along with the target pre context to transpile the block from x86 to armv8_64.\n\n```x86asm\n; <pre-context>\n\tmovq\t-8(%rbp), %rdi\n\tmovl\tIXGBE_GCR_EXT(%rip), %esi\n\tmovq\t-16(%rbp), %rdx\n\tcallq\tIXGBE_WRITE_REG@PLT\n\tmovq\t-8(%rbp), %rdi\n\n; <block>\n\tmovl\tIXGBE_HLREG0(%rip), %esi\n\tmovq\t-24(%rbp), %rdx\n\tcallq\tIXGBE_WRITE_REG@PLT\n.LBB0_11:\n\taddq\t$48, %rsp\n\tpopq\t%rbp\n\t.cfi_def_cfa %rsp, 8\n\tretq\n.Lfunc_end0:\n\t.size\tixgbe_clear_tx_pending, .Lfunc_end0-ixgbe_clear_tx_pending\n\t.cfi_endproc\n # -- End function\n\t.type\tIXGBE_FLAGS_DOUBLE_RESET_REQUIRED,@object # @IXGBE_FLAGS_DOUBLE_RESET_REQUIRED\n\t.bss\n\t.globl\tIXGBE_FLAGS_DOUBLE_RESET_REQUIRED\n\t.p2align\t2, 0x0\nIXGBE_FLAGS_DOUBLE_RESET_REQUIRED:\n\t.long\t0 # 0x0\n\t.size\tIXGBE_FLAGS_DOUBLE_RESET_REQUIRED, 4\n\n\t.type\tIXGBE_HLREG0,@object # @IXGBE_HLREG0\n\t.globl\tIXGBE_HLREG0\n\t.p2align\t2, 0x0\nIXGBE_HLREG0:\n\t.long\t0 # 0x0\n\t.size\tIXGBE_HLREG0, 4\n\n\t.type\tIXGBE_HLREG0_LPBK,@object # @IXGBE_HLREG0_LPBK\n\t.globl\tIXGBE_HLREG0_LPBK\n\t.p2align\t3, 0x0\nIXGBE_HLREG0_LPBK:\n\t.quad\t0 # 0x0\n\t.size\tIXGBE_HLREG0_LPBK, 8\n\n\t.type\tIXGBE_PCI_DEVICE_STATUS,@object # @IXGBE_PCI_DEVICE_STATUS\n\t.globl\tIXGBE_PCI_DEVICE_STATUS\n\t.p2align\t2, 0x0\nIXGBE_PCI_DEVICE_STATUS:\n\t.long\t0 # 0x0\n\t.size\tIXGBE_PCI_DEVICE_STATUS, 4\n\n\t.type\tIXGBE_PCI_DEVICE_STATUS_TRANSACTION_PENDING,@object # @IXGBE_PCI_DEVICE_STATUS_TRANSACTION_PENDING\n\t.globl\tIXGBE_PCI_DEVICE_STATUS_TRANSACTION_PENDING\n\t.p2align\t2, 0x0\nIXGBE_PCI_DEVICE_STATUS_TRANSACTION_PENDING:\n\t.long\t0 # 0x0\n\t.size\tIXGBE_PCI_DEVICE_STATUS_TRANSACTION_PENDING, 4\n\n\t.type\tIXGBE_GCR_EXT,@object # @IXGBE_GCR_EXT\n\t.globl\tIXGBE_GCR_EXT\n\t.p2align\t2, 0x0\nIXGBE_GCR_EXT:\n\t.long\t0 # 0x0\n\t.size\tIXGBE_GCR_EXT, 4\n\n\t.type\tIXGBE_GCR_EXT_BUFFERS_CLEAR,@object # @IXGBE_GCR_EXT_BUFFERS_CLEAR\n\t.globl\tIXGBE_GCR_EXT_BUFFERS_CLEAR\n\t.p2align\t3, 0x0\nIXGBE_GCR_EXT_BUFFERS_CLEAR:\n\t.quad\t0 # 0x0\n\t.size\tIXGBE_GCR_EXT_BUFFERS_CLEAR, 8\n\n\t.ident\t\"Ubuntu clang version 18.1.3 (1ubuntu1)\"\n\t.section\t\".note.GNU-stack\",\"\",@progbits\n\t.addrsig\n\t.addrsig_sym IXGBE_READ_REG\n\t.addrsig_sym IXGBE_WRITE_REG\n\t.addrsig_sym IXGBE_WRITE_FLUSH\n\t.addrsig_sym usleep_range\n\t.addrsig_sym ixgbe_pcie_timeout_poll\n\t.addrsig_sym ixgbe_read_pci_cfg_word\n\t.addrsig_sym ixgbe_removed\n\t.addrsig_sym udelay\n\t.addrsig_sym IXGBE_FLAGS_DOUBLE_RESET_REQUIRED\n\t.addrsig_sym IXGBE_HLREG0\n\t.addrsig_sym IXGBE_HLREG0_LPBK\n\t.addrsig_sym IXGBE_PCI_DEVICE_STATUS\n\t.addrsig_sym IXGBE_PCI_DEVICE_STATUS_TRANSACTION_PENDING\n\t.addrsig_sym IXGBE_GCR_EXT\n\t.addrsig_sym IXGBE_GCR_EXT_BUFFERS_CLEAR\n\n; <post-context>\n\n```\n\n```armasm\n; <pre-target>\n\t.cfi_startproc\n; %bb.0:\n\tsub\tsp, sp, #80\n\t.cfi_def_cfa_offset 80\n\tstp\tx29, x30, [sp, #64] ; 16-byte Folded Spill\n\tadd\tx29, sp, #64\n\t.cfi_def_cfa w29, 16\n\t.cfi_offset w30, -8\n\t.cfi_offset w29, -16\n\tadrp\tx8, _IXGBE_HLREG0@GOTPAGE\n\tldr\tx8, [x8, _IXGBE_HLREG0@GOTPAGEOFF]\n\tstr\tx8, [sp] ; 8-byte Folded Spill\n\tadrp\tx8, _IXGBE_GCR_EXT@GOTPAGE\n\tldr\tx8, [x8, _IXGBE_GCR_EXT@GOTPAGEOFF]\n\tstr\tx8, [sp, #8] ; 8-byte Folded Spill\n\tstur\tx0, [x29, #-8]\n\tldur\tx8, [x29, #-8]\n\tldr\tw8, [x8, #4]\n\tadrp\tx9, _IXGBE_FLAGS_DOUBLE_RESET_REQUIRED@GOTPAGE\n\tldr\tx9, [x9, _IXGBE_FLAGS_DOUBLE_RESET_REQUIRED@GOTPAGEOFF]\n\tldr\tw9, [x9]\n\tands\tw8, w8, w9\n\tcset\tw8, ne\n\ttbnz\tw8, #0, LBB0_2\n\tb\tLBB0_1\nLBB0_1:\n\tb\tLBB0_11\nLBB0_2:\n\tldr\tx8, [sp] ; 8-byte Folded Reload\n\tldur\tx0, [x29, #-8]\n\tldr\tw1, [x8]\n\tbl\t_IXGBE_READ_REG\n\tldr\tx8, [sp] ; 8-byte Folded Reload\n\tstur\tx0, [x29, #-24]\n\tldur\tx0, [x29, #-8]\n\tldr\tw1, [x8]\n\tldur\tx8, [x29, #-24]\n\tadrp\tx9, _IXGBE_HLREG0_LPBK@GOTPAGE\n\tldr\tx9, [x9, _IXGBE_HLREG0_LPBK@GOTPAGEOFF]\n\tldr\tx9, [x9]\n\torr\tx2, x8, x9\n\tbl\t_IXGBE_WRITE_REG\n\tldur\tx0, [x29, #-8]\n\tbl\t_IXGBE_WRITE_FLUSH\n\tmov\tw0, #3000\n\tmov\tw1, #6000\n\tbl\t_usleep_range\n\tldur\tx0, [x29, #-8]\n\tbl\t_ixgbe_pcie_timeout_poll\n\tstr\tx0, [sp, #24]\n\tstr\txzr, [sp, #32]\n\tb\tLBB0_3\nLBB0_3: ; =>This Inner Loop Header: Depth=1\n\tldr\tx8, [sp, #32]\n\tldr\tx9, [sp, #24]\n\tsubs\tx8, x8, x9\n\tcset\tw8, ge\n\ttbnz\tw8, #0, LBB0_10\n\tb\tLBB0_4\nLBB0_4: ; in Loop: Header=BB0_3 Depth=1\n\tmov\tw0, #100\n\tmov\tw1, #200\n\tbl\t_usleep_range\n\tldur\tx0, [x29, #-8]\n\tadrp\tx8, _IXGBE_PCI_DEVICE_STATUS@GOTPAGE\n\tldr\tx8, [x8, _IXGBE_PCI_DEVICE_STATUS@GOTPAGEOFF]\n\tldr\tw1, [x8]\n\tbl\t_ixgbe_read_pci_cfg_word\n\tstr\tw0, [sp, #20]\n\tldur\tx8, [x29, #-8]\n\tldr\tw0, [x8]\n\tbl\t_ixgbe_removed\n\tsubs\tx8, x0, #0\n\tcset\tw8, eq\n\ttbnz\tw8, #0, LBB0_6\n\tb\tLBB0_5\nLBB0_5:\n\tb\tLBB0_10\nLBB0_6: ; in Loop: Header=BB0_3 Depth=1\n\tldr\tw8, [sp, #20]\n\tadrp\tx9, _IXGBE_PCI_DEVICE_STATUS_TRANSACTION_PENDING@GOTPAGE\n\tldr\tx9, [x9, _IXGBE_PCI_DEVICE_STATUS_TRANSACTION_PENDING@GOTPAGEOFF]\n\tldr\tw9, [x9]\n\tands\tw8, w8, w9\n\tcset\tw8, ne\n\ttbnz\tw8, #0, LBB0_8\n\tb\tLBB0_7\nLBB0_7:\n\tb\tLBB0_10\nLBB0_8: ; in Loop: Header=BB0_3 Depth=1\n\tb\tLBB0_9\nLBB0_9: ; in Loop: Header=BB0_3 Depth=1\n\tldr\tx8, [sp, #32]\n\tadd\tx8, x8, #1\n\tstr\tx8, [sp, #32]\n\tb\tLBB0_3\nLBB0_10:\n\tldr\tx8, [sp, #8] ; 8-byte Folded Reload\n\tldur\tx0, [x29, #-8]\n\tldr\tw1, [x8]\n\tbl\t_IXGBE_READ_REG\n\tldr\tx8, [sp, #8] ; 8-byte Folded Reload\n\tstur\tx0, [x29, #-16]\n\tldur\tx0, [x29, #-8]\n\tldr\tw1, [x8]\n\tldur\tx8, [x29, #-16]\n\tadrp\tx9, _IXGBE_GCR_EXT_BUFFERS_CLEAR@GOTPAGE\n\tldr\tx9, [x9, _IXGBE_GCR_EXT_BUFFERS_CLEAR@GOTPAGEOFF]\n\tldr\tx9, [x9]\n\torr\tx2, x8, x9\n\tbl\t_IXGBE_WRITE_REG\n\tldur\tx0, [x29, #-8]\n\tbl\t_IXGBE_WRITE_FLUSH\n\tmov\tw0, #20\n\tbl\t_udelay\n\tldr\tx8, [sp, #8] ; 8-byte Folded Reload\n\tldur\tx0, [x29, #-8]\n\tldr\tw1, [x8]\n\tldur\tx2, [x29, #-16]\n\tbl\t_IXGBE_WRITE_REG\n\tldr\tx8, [sp] ; 8-byte Folded Reload\n\tldur\tx0, [x29, #-8]\n\n```", "role": "user" }, { "content": "```armasm\n\tldr\tw1, [x8]\n\tldur\tx2, [x29, #-24]\n\tbl\t_IXGBE_WRITE_REG\n\tb\tLBB0_11\nLBB0_11:\n\tldp\tx29, x30, [sp, #64] ; 16-byte Folded Reload\n\tadd\tsp, sp, #80\n\tret\n\t.cfi_endproc\n ; -- End function\n\t.comm\t_IXGBE_FLAGS_DOUBLE_RESET_REQUIRED,4,2 ; @IXGBE_FLAGS_DOUBLE_RESET_REQUIRED\n\t.comm\t_IXGBE_HLREG0,4,2 ; @IXGBE_HLREG0\n\t.comm\t_IXGBE_HLREG0_LPBK,8,3 ; @IXGBE_HLREG0_LPBK\n\t.comm\t_IXGBE_PCI_DEVICE_STATUS,4,2 ; @IXGBE_PCI_DEVICE_STATUS\n\t.comm\t_IXGBE_PCI_DEVICE_STATUS_TRANSACTION_PENDING,4,2 ; @IXGBE_PCI_DEVICE_STATUS_TRANSACTION_PENDING\n\t.comm\t_IXGBE_GCR_EXT,4,2 ; @IXGBE_GCR_EXT\n\t.comm\t_IXGBE_GCR_EXT_BUFFERS_CLEAR,8,3 ; @IXGBE_GCR_EXT_BUFFERS_CLEAR\n.subsections_via_symbols\n```", "role": "assistant" } ]
extr_igc_ethtool.c_igc_get_msglevel.c
[ { "content": "You are given an x86 assembly block (<block>) to traspile into armv8_64 assembly.\nYou are also given the context for this block in the form of pre-context (<pre_context>) and post-context (<post_context>).\nThere is also a pre-target-context (<pre_target>) which is the context for the target block. Use the input pre and post context along with the target pre context to transpile the block from x86 to armv8_64.\n\n```x86asm\n; <pre-context>\n\n; <block>\n\t.text\n\t.file\t\"extr_igc_ethtool.c_igc_get_msglevel.c\"\n\t.p2align\t4, 0x90 # -- Begin function igc_get_msglevel\n\t.type\tigc_get_msglevel,@function\nigc_get_msglevel: # @igc_get_msglevel\n\t.cfi_startproc\n# %bb.0:\n\tpushq\t%rbp\n\t.cfi_def_cfa_offset 16\n\t.cfi_offset %rbp, -16\n\tmovq\t%rsp, %rbp\n\t.cfi_def_cfa_register %rbp\n\tsubq\t$16, %rsp\n\tmovq\t%rdi, -8(%rbp)\n\tmovq\t-8(%rbp), %rdi\n\tcallq\tnetdev_priv@PLT\n\tmovq\t%rax, -16(%rbp)\n\tmovq\t-16(%rbp), %rax\n\tmovl\t(%rax), %eax\n\taddq\t$16, %rsp\n\tpopq\t%rbp\n\t.cfi_def_cfa %rsp, 8\n\tretq\n.Lfunc_end0:\n\t.size\tigc_get_msglevel, .Lfunc_end0-igc_get_msglevel\n\t.cfi_endproc\n # -- End function\n\t.ident\t\"Ubuntu clang version 18.1.3 (1ubuntu1)\"\n\t.section\t\".note.GNU-stack\",\"\",@progbits\n\t.addrsig\n\t.addrsig_sym igc_get_msglevel\n\t.addrsig_sym netdev_priv\n\n; <post-context>\n\n```\n\n```armasm\n; <pre-target>\n\n```", "role": "user" }, { "content": "```armasm\n\t.section\t__TEXT,__text,regular,pure_instructions\n\t.build_version macos, 13, 0\tsdk_version 13, 3\n\t.p2align\t2 ; -- Begin function igc_get_msglevel\n_igc_get_msglevel: ; @igc_get_msglevel\n\t.cfi_startproc\n; %bb.0:\n\tsub\tsp, sp, #32\n\t.cfi_def_cfa_offset 32\n\tstp\tx29, x30, [sp, #16] ; 16-byte Folded Spill\n\tadd\tx29, sp, #16\n\t.cfi_def_cfa w29, 16\n\t.cfi_offset w30, -8\n\t.cfi_offset w29, -16\n\tstr\tx0, [sp, #8]\n\tldr\tx0, [sp, #8]\n\tbl\t_netdev_priv\n\tstr\tx0, [sp]\n\tldr\tx8, [sp]\n\tldr\tw0, [x8]\n\tldp\tx29, x30, [sp, #16] ; 16-byte Folded Reload\n\tadd\tsp, sp, #32\n\tret\n\t.cfi_endproc\n ; -- End function\n\t.no_dead_strip\t_igc_get_msglevel\n.subsections_via_symbols\n```", "role": "assistant" } ]
extr_win32_init.c__glfwPlatformTerminate.c
[ { "content": "You are given an x86 assembly block (<block>) to traspile into armv8_64 assembly.\nYou are also given the context for this block in the form of pre-context (<pre_context>) and post-context (<post_context>).\nThere is also a pre-target-context (<pre_target>) which is the context for the target block. Use the input pre and post context along with the target pre context to transpile the block from x86 to armv8_64.\n\n```x86asm\n; <pre-context>\n\n; <block>\n\t.text\n\t.file\t\"extr_win32_init.c__glfwPlatformTerminate.c\"\n\t.globl\t_glfwPlatformTerminate # -- Begin function _glfwPlatformTerminate\n\t.p2align\t4, 0x90\n\t.type\t_glfwPlatformTerminate,@function\n_glfwPlatformTerminate: # @_glfwPlatformTerminate\n\t.cfi_startproc\n# %bb.0:\n\tpushq\t%rbp\n\t.cfi_def_cfa_offset 16\n\t.cfi_offset %rbp, -16\n\tmovq\t%rsp, %rbp\n\t.cfi_def_cfa_register %rbp\n\tsubq\t$16, %rsp\n\tcmpq\t$0, _glfw+24(%rip)\n\tje\t.LBB0_2\n# %bb.1:\n\tmovq\t_glfw+24(%rip), %rdi\n\tcallq\tUnregisterDeviceNotification@PLT\n.LBB0_2:\n\tcmpq\t$0, _glfw+16(%rip)\n\tje\t.LBB0_4\n# %bb.3:\n\tmovq\t_glfw+16(%rip), %rdi\n\tcallq\tDestroyWindow@PLT\n.LBB0_4:\n\n; <post-context>\n\tmovb\t$0, %al\n\tcallq\t_glfwUnregisterWindowClassWin32@PLT\n\tmovl\tSPI_SETFOREGROUNDLOCKTIMEOUT(%rip), %eax\n\tmovl\t%eax, -4(%rbp) # 4-byte Spill\n\tmovl\t_glfw+8(%rip), %edi\n\tcallq\tUIntToPtr@PLT\n\tmovl\t-4(%rbp), %edi # 4-byte Reload\n\tmovl\t%eax, %edx\n\tmovl\tSPIF_SENDCHANGE(%rip), %ecx\n\n```\n\n```armasm\n; <pre-target>\n\n```", "role": "user" }, { "content": "```armasm\n\t.section\t__TEXT,__text,regular,pure_instructions\n\t.build_version macos, 13, 0\tsdk_version 13, 3\n\t.globl\t__glfwPlatformTerminate ; -- Begin function _glfwPlatformTerminate\n\t.p2align\t2\n__glfwPlatformTerminate: ; @_glfwPlatformTerminate\n\t.cfi_startproc\n; %bb.0:\n\tsub\tsp, sp, #32\n\t.cfi_def_cfa_offset 32\n\tstp\tx29, x30, [sp, #16] ; 16-byte Folded Spill\n\tadd\tx29, sp, #16\n\t.cfi_def_cfa w29, 16\n\t.cfi_offset w30, -8\n\t.cfi_offset w29, -16\n\tadrp\tx8, __glfw@GOTPAGE\n\tldr\tx8, [x8, __glfw@GOTPAGEOFF]\n\tstr\tx8, [sp, #8] ; 8-byte Folded Spill\n\tldr\tx8, [x8, #24]\n\tsubs\tx8, x8, #0\n\tcset\tw8, eq\n\ttbnz\tw8, #0, LBB0_2\n\tb\tLBB0_1\nLBB0_1:\n\tldr\tx8, [sp, #8] ; 8-byte Folded Reload\n\tldr\tx0, [x8, #24]\n\tbl\t_UnregisterDeviceNotification\n\tb\tLBB0_2\nLBB0_2:\n\tldr\tx8, [sp, #8] ; 8-byte Folded Reload\n\tldr\tx8, [x8, #16]\n\tsubs\tx8, x8, #0\n\tcset\tw8, eq\n\ttbnz\tw8, #0, LBB0_4\n\tb\tLBB0_3\nLBB0_3:\n\tldr\tx8, [sp, #8] ; 8-byte Folded Reload\n\tldr\tx0, [x8, #16]\n\tbl\t_DestroyWindow\n\tb\tLBB0_4\nLBB0_4:\n```", "role": "assistant" } ]
extr_win32_init.c__glfwPlatformTerminate.c
[ { "content": "You are given an x86 assembly block (<block>) to traspile into armv8_64 assembly.\nYou are also given the context for this block in the form of pre-context (<pre_context>) and post-context (<post_context>).\nThere is also a pre-target-context (<pre_target>) which is the context for the target block. Use the input pre and post context along with the target pre context to transpile the block from x86 to armv8_64.\n\n```x86asm\n; <pre-context>\n\tcallq\tUnregisterDeviceNotification@PLT\n.LBB0_2:\n\tcmpq\t$0, _glfw+16(%rip)\n\tje\t.LBB0_4\n# %bb.3:\n\tmovq\t_glfw+16(%rip), %rdi\n\tcallq\tDestroyWindow@PLT\n.LBB0_4:\n\n; <block>\n\tmovb\t$0, %al\n\tcallq\t_glfwUnregisterWindowClassWin32@PLT\n\tmovl\tSPI_SETFOREGROUNDLOCKTIMEOUT(%rip), %eax\n\tmovl\t%eax, -4(%rbp) # 4-byte Spill\n\tmovl\t_glfw+8(%rip), %edi\n\tcallq\tUIntToPtr@PLT\n\tmovl\t-4(%rbp), %edi # 4-byte Reload\n\tmovl\t%eax, %edx\n\tmovl\tSPIF_SENDCHANGE(%rip), %ecx\n\txorl\t%esi, %esi\n\tcallq\tSystemParametersInfoW@PLT\n\tmovl\t_glfw+4(%rip), %edi\n\tcallq\tfree@PLT\n\tmovl\t_glfw(%rip), %edi\n\tcallq\tfree@PLT\n\n; <post-context>\n\tmovb\t$0, %al\n\tcallq\t_glfwTerminateWGL@PLT\n\tmovb\t$0, %al\n\tcallq\t_glfwTerminateEGL@PLT\n\tmovb\t$0, %al\n\tcallq\t_glfwTerminateJoysticksWin32@PLT\n\tmovb\t$0, %al\n\tcallq\tfreeLibraries@PLT\n\taddq\t$16, %rsp\n\tpopq\t%rbp\n\t.cfi_def_cfa %rsp, 8\n\tretq\n.Lfunc_end0:\n\t.size\t_glfwPlatformTerminate, .Lfunc_end0-_glfwPlatformTerminate\n\t.cfi_endproc\n # -- End function\n\t.type\t_glfw,@object # @_glfw\n\t.bss\n\t.globl\t_glfw\n\t.p2align\t3, 0x0\n_glfw:\n\t.zero\t32\n\t.size\t_glfw, 32\n\n\t.type\tSPI_SETFOREGROUNDLOCKTIMEOUT,@object # @SPI_SETFOREGROUNDLOCKTIMEOUT\n\t.globl\tSPI_SETFOREGROUNDLOCKTIMEOUT\n\t.p2align\t2, 0x0\nSPI_SETFOREGROUNDLOCKTIMEOUT:\n\t.long\t0 # 0x0\n\t.size\tSPI_SETFOREGROUNDLOCKTIMEOUT, 4\n\n\t.type\tSPIF_SENDCHANGE,@object # @SPIF_SENDCHANGE\n\t.globl\tSPIF_SENDCHANGE\n\t.p2align\t2, 0x0\nSPIF_SENDCHANGE:\n\t.long\t0 # 0x0\n\t.size\tSPIF_SENDCHANGE, 4\n\n\t.ident\t\"Ubuntu clang version 18.1.3 (1ubuntu1)\"\n\t.section\t\".note.GNU-stack\",\"\",@progbits\n\t.addrsig\n\t.addrsig_sym UnregisterDeviceNotification\n\t.addrsig_sym DestroyWindow\n\t.addrsig_sym _glfwUnregisterWindowClassWin32\n\t.addrsig_sym SystemParametersInfoW\n\t.addrsig_sym UIntToPtr\n\t.addrsig_sym free\n\t.addrsig_sym _glfwTerminateWGL\n\t.addrsig_sym _glfwTerminateEGL\n\t.addrsig_sym _glfwTerminateJoysticksWin32\n\t.addrsig_sym freeLibraries\n\t.addrsig_sym _glfw\n\t.addrsig_sym SPI_SETFOREGROUNDLOCKTIMEOUT\n\t.addrsig_sym SPIF_SENDCHANGE\n\n```\n\n```armasm\n; <pre-target>\n\t.cfi_startproc\n; %bb.0:\n\tsub\tsp, sp, #32\n\t.cfi_def_cfa_offset 32\n\tstp\tx29, x30, [sp, #16] ; 16-byte Folded Spill\n\tadd\tx29, sp, #16\n\t.cfi_def_cfa w29, 16\n\t.cfi_offset w30, -8\n\t.cfi_offset w29, -16\n\tadrp\tx8, __glfw@GOTPAGE\n\tldr\tx8, [x8, __glfw@GOTPAGEOFF]\n\tstr\tx8, [sp, #8] ; 8-byte Folded Spill\n\tldr\tx8, [x8, #24]\n\tsubs\tx8, x8, #0\n\tcset\tw8, eq\n\ttbnz\tw8, #0, LBB0_2\n\tb\tLBB0_1\nLBB0_1:\n\tldr\tx8, [sp, #8] ; 8-byte Folded Reload\n\tldr\tx0, [x8, #24]\n\tbl\t_UnregisterDeviceNotification\n\tb\tLBB0_2\nLBB0_2:\n\tldr\tx8, [sp, #8] ; 8-byte Folded Reload\n\tldr\tx8, [x8, #16]\n\tsubs\tx8, x8, #0\n\tcset\tw8, eq\n\ttbnz\tw8, #0, LBB0_4\n\tb\tLBB0_3\nLBB0_3:\n\tldr\tx8, [sp, #8] ; 8-byte Folded Reload\n\tldr\tx0, [x8, #16]\n\tbl\t_DestroyWindow\n\tb\tLBB0_4\nLBB0_4:\n\n```", "role": "user" }, { "content": "```armasm\n\tbl\t__glfwUnregisterWindowClassWin32\n\tldr\tx8, [sp, #8] ; 8-byte Folded Reload\n\tadrp\tx9, _SPI_SETFOREGROUNDLOCKTIMEOUT@GOTPAGE\n\tldr\tx9, [x9, _SPI_SETFOREGROUNDLOCKTIMEOUT@GOTPAGEOFF]\n\tldr\tw9, [x9]\n\tstr\tw9, [sp, #4] ; 4-byte Folded Spill\n\tldr\tw0, [x8, #8]\n\tbl\t_UIntToPtr\n\tmov\tx2, x0\n\tldr\tw0, [sp, #4] ; 4-byte Folded Reload\n\tadrp\tx8, _SPIF_SENDCHANGE@GOTPAGE\n\tldr\tx8, [x8, _SPIF_SENDCHANGE@GOTPAGEOFF]\n\tldr\tw3, [x8]\n\tmov\tw1, #0\n\tbl\t_SystemParametersInfoW\n\tldr\tx8, [sp, #8] ; 8-byte Folded Reload\n\tldr\tw0, [x8, #4]\n\tbl\t_free\n\tldr\tx8, [sp, #8] ; 8-byte Folded Reload\n\tldr\tw0, [x8]\n\tbl\t_free\n```", "role": "assistant" } ]
extr_win32_init.c__glfwPlatformTerminate.c
[ { "content": "You are given an x86 assembly block (<block>) to traspile into armv8_64 assembly.\nYou are also given the context for this block in the form of pre-context (<pre_context>) and post-context (<post_context>).\nThere is also a pre-target-context (<pre_target>) which is the context for the target block. Use the input pre and post context along with the target pre context to transpile the block from x86 to armv8_64.\n\n```x86asm\n; <pre-context>\n\txorl\t%esi, %esi\n\tcallq\tSystemParametersInfoW@PLT\n\tmovl\t_glfw+4(%rip), %edi\n\tcallq\tfree@PLT\n\tmovl\t_glfw(%rip), %edi\n\tcallq\tfree@PLT\n\n; <block>\n\tmovb\t$0, %al\n\tcallq\t_glfwTerminateWGL@PLT\n\tmovb\t$0, %al\n\tcallq\t_glfwTerminateEGL@PLT\n\tmovb\t$0, %al\n\tcallq\t_glfwTerminateJoysticksWin32@PLT\n\tmovb\t$0, %al\n\tcallq\tfreeLibraries@PLT\n\taddq\t$16, %rsp\n\tpopq\t%rbp\n\t.cfi_def_cfa %rsp, 8\n\tretq\n.Lfunc_end0:\n\t.size\t_glfwPlatformTerminate, .Lfunc_end0-_glfwPlatformTerminate\n\t.cfi_endproc\n # -- End function\n\t.type\t_glfw,@object # @_glfw\n\t.bss\n\t.globl\t_glfw\n\t.p2align\t3, 0x0\n_glfw:\n\t.zero\t32\n\t.size\t_glfw, 32\n\n\t.type\tSPI_SETFOREGROUNDLOCKTIMEOUT,@object # @SPI_SETFOREGROUNDLOCKTIMEOUT\n\t.globl\tSPI_SETFOREGROUNDLOCKTIMEOUT\n\t.p2align\t2, 0x0\nSPI_SETFOREGROUNDLOCKTIMEOUT:\n\t.long\t0 # 0x0\n\t.size\tSPI_SETFOREGROUNDLOCKTIMEOUT, 4\n\n\t.type\tSPIF_SENDCHANGE,@object # @SPIF_SENDCHANGE\n\t.globl\tSPIF_SENDCHANGE\n\t.p2align\t2, 0x0\nSPIF_SENDCHANGE:\n\t.long\t0 # 0x0\n\t.size\tSPIF_SENDCHANGE, 4\n\n\t.ident\t\"Ubuntu clang version 18.1.3 (1ubuntu1)\"\n\t.section\t\".note.GNU-stack\",\"\",@progbits\n\t.addrsig\n\t.addrsig_sym UnregisterDeviceNotification\n\t.addrsig_sym DestroyWindow\n\t.addrsig_sym _glfwUnregisterWindowClassWin32\n\t.addrsig_sym SystemParametersInfoW\n\t.addrsig_sym UIntToPtr\n\t.addrsig_sym free\n\t.addrsig_sym _glfwTerminateWGL\n\t.addrsig_sym _glfwTerminateEGL\n\t.addrsig_sym _glfwTerminateJoysticksWin32\n\t.addrsig_sym freeLibraries\n\t.addrsig_sym _glfw\n\t.addrsig_sym SPI_SETFOREGROUNDLOCKTIMEOUT\n\t.addrsig_sym SPIF_SENDCHANGE\n\n; <post-context>\n\n```\n\n```armasm\n; <pre-target>\n\t.cfi_startproc\n; %bb.0:\n\tsub\tsp, sp, #32\n\t.cfi_def_cfa_offset 32\n\tstp\tx29, x30, [sp, #16] ; 16-byte Folded Spill\n\tadd\tx29, sp, #16\n\t.cfi_def_cfa w29, 16\n\t.cfi_offset w30, -8\n\t.cfi_offset w29, -16\n\tadrp\tx8, __glfw@GOTPAGE\n\tldr\tx8, [x8, __glfw@GOTPAGEOFF]\n\tstr\tx8, [sp, #8] ; 8-byte Folded Spill\n\tldr\tx8, [x8, #24]\n\tsubs\tx8, x8, #0\n\tcset\tw8, eq\n\ttbnz\tw8, #0, LBB0_2\n\tb\tLBB0_1\nLBB0_1:\n\tldr\tx8, [sp, #8] ; 8-byte Folded Reload\n\tldr\tx0, [x8, #24]\n\tbl\t_UnregisterDeviceNotification\n\tb\tLBB0_2\nLBB0_2:\n\tldr\tx8, [sp, #8] ; 8-byte Folded Reload\n\tldr\tx8, [x8, #16]\n\tsubs\tx8, x8, #0\n\tcset\tw8, eq\n\ttbnz\tw8, #0, LBB0_4\n\tb\tLBB0_3\nLBB0_3:\n\tldr\tx8, [sp, #8] ; 8-byte Folded Reload\n\tldr\tx0, [x8, #16]\n\tbl\t_DestroyWindow\n\tb\tLBB0_4\nLBB0_4:\n\tbl\t__glfwUnregisterWindowClassWin32\n\tldr\tx8, [sp, #8] ; 8-byte Folded Reload\n\tadrp\tx9, _SPI_SETFOREGROUNDLOCKTIMEOUT@GOTPAGE\n\tldr\tx9, [x9, _SPI_SETFOREGROUNDLOCKTIMEOUT@GOTPAGEOFF]\n\tldr\tw9, [x9]\n\tstr\tw9, [sp, #4] ; 4-byte Folded Spill\n\tldr\tw0, [x8, #8]\n\tbl\t_UIntToPtr\n\tmov\tx2, x0\n\tldr\tw0, [sp, #4] ; 4-byte Folded Reload\n\tadrp\tx8, _SPIF_SENDCHANGE@GOTPAGE\n\tldr\tx8, [x8, _SPIF_SENDCHANGE@GOTPAGEOFF]\n\tldr\tw3, [x8]\n\tmov\tw1, #0\n\tbl\t_SystemParametersInfoW\n\tldr\tx8, [sp, #8] ; 8-byte Folded Reload\n\tldr\tw0, [x8, #4]\n\tbl\t_free\n\tldr\tx8, [sp, #8] ; 8-byte Folded Reload\n\tldr\tw0, [x8]\n\tbl\t_free\n\n```", "role": "user" }, { "content": "```armasm\n\tbl\t__glfwTerminateWGL\n\tbl\t__glfwTerminateEGL\n\tbl\t__glfwTerminateJoysticksWin32\n\tbl\t_freeLibraries\n\tldp\tx29, x30, [sp, #16] ; 16-byte Folded Reload\n\tadd\tsp, sp, #32\n\tret\n\t.cfi_endproc\n ; -- End function\n\t.comm\t__glfw,32,3 ; @_glfw\n\t.comm\t_SPI_SETFOREGROUNDLOCKTIMEOUT,4,2 ; @SPI_SETFOREGROUNDLOCKTIMEOUT\n\t.comm\t_SPIF_SENDCHANGE,4,2 ; @SPIF_SENDCHANGE\n.subsections_via_symbols\n```", "role": "assistant" } ]
extr_arch.c_Arch_Touch.c
[ { "content": "You are given an x86 assembly block (<block>) to traspile into armv8_64 assembly.\nYou are also given the context for this block in the form of pre-context (<pre_context>) and post-context (<post_context>).\nThere is also a pre-target-context (<pre_target>) which is the context for the target block. Use the input pre and post context along with the target pre context to transpile the block from x86 to armv8_64.\n\n```x86asm\n; <pre-context>\n\n; <block>\n\t.text\n\t.file\t\"extr_arch.c_Arch_Touch.c\"\n\t.globl\tArch_Touch # -- Begin function Arch_Touch\n\t.p2align\t4, 0x90\n\t.type\tArch_Touch,@function\nArch_Touch: # @Arch_Touch\n\t.cfi_startproc\n# %bb.0:\n\tpushq\t%rbp\n\t.cfi_def_cfa_offset 16\n\t.cfi_offset %rbp, -16\n\tmovq\t%rsp, %rbp\n\t.cfi_def_cfa_register %rbp\n\tsubq\t$48, %rsp\n\tmovq\t%rdi, -8(%rbp)\n\tmovl\tARCHIVE(%rip), %edi\n\tmovq\t-8(%rbp), %rsi\n\tleaq\t-32(%rbp), %rdx\n\tcallq\tVar_Value@PLT\n\tmovl\t%eax, -44(%rbp) # 4-byte Spill\n\tmovl\tMEMBER(%rip), %edi\n\tmovq\t-8(%rbp), %rsi\n\tleaq\t-40(%rbp), %rdx\n\tcallq\tVar_Value@PLT\n\tmovl\t-44(%rbp), %edi # 4-byte Reload\n\tmovl\t%eax, %esi\n\tleaq\t-20(%rbp), %rdx\n\tleaq\t.L.str(%rip), %rcx\n\tcallq\tArchFindMember@PLT\n\tmovq\t%rax, -16(%rbp)\n\n; <post-context>\n\tmovq\t-32(%rbp), %rdi\n\tcallq\tfree@PLT\n\tmovq\t-40(%rbp), %rdi\n\tcallq\tfree@PLT\n\tmovl\t-20(%rbp), %edi\n\n```\n\n```armasm\n; <pre-target>\n\n```", "role": "user" }, { "content": "```armasm\n\t.section\t__TEXT,__text,regular,pure_instructions\n\t.build_version macos, 13, 0\tsdk_version 13, 3\n\t.globl\t_Arch_Touch ; -- Begin function Arch_Touch\n\t.p2align\t2\n_Arch_Touch: ; @Arch_Touch\n\t.cfi_startproc\n; %bb.0:\n\tsub\tsp, sp, #64\n\t.cfi_def_cfa_offset 64\n\tstp\tx29, x30, [sp, #48] ; 16-byte Folded Spill\n\tadd\tx29, sp, #48\n\t.cfi_def_cfa w29, 16\n\t.cfi_offset w30, -8\n\t.cfi_offset w29, -16\n\tstur\tx0, [x29, #-8]\n\tadrp\tx8, _ARCHIVE@GOTPAGE\n\tldr\tx8, [x8, _ARCHIVE@GOTPAGEOFF]\n\tldr\tw0, [x8]\n\tldur\tx1, [x29, #-8]\n\tadd\tx2, sp, #16\n\tbl\t_Var_Value\n\tstr\tw0, [sp, #4] ; 4-byte Folded Spill\n\tadrp\tx8, _MEMBER@GOTPAGE\n\tldr\tx8, [x8, _MEMBER@GOTPAGEOFF]\n\tldr\tw0, [x8]\n\tldur\tx1, [x29, #-8]\n\tadd\tx2, sp, #8\n\tbl\t_Var_Value\n\tmov\tx1, x0\n\tldr\tw0, [sp, #4] ; 4-byte Folded Reload\n\tsub\tx2, x29, #20\n\tadrp\tx3, l_.str@PAGE\n\tadd\tx3, x3, l_.str@PAGEOFF\n\tbl\t_ArchFindMember\n\tstur\tx0, [x29, #-16]\n```", "role": "assistant" } ]
extr_arch.c_Arch_Touch.c
[ { "content": "You are given an x86 assembly block (<block>) to traspile into armv8_64 assembly.\nYou are also given the context for this block in the form of pre-context (<pre_context>) and post-context (<post_context>).\nThere is also a pre-target-context (<pre_target>) which is the context for the target block. Use the input pre and post context along with the target pre context to transpile the block from x86 to armv8_64.\n\n```x86asm\n; <pre-context>\n\tmovl\tMEMBER(%rip), %edi\n\tmovq\t-8(%rbp), %rsi\n\tleaq\t-40(%rbp), %rdx\n\tcallq\tVar_Value@PLT\n\tmovl\t-44(%rbp), %edi # 4-byte Reload\n\tmovl\t%eax, %esi\n\tleaq\t-20(%rbp), %rdx\n\tleaq\t.L.str(%rip), %rcx\n\tcallq\tArchFindMember@PLT\n\tmovq\t%rax, -16(%rbp)\n\n; <block>\n\tmovq\t-32(%rbp), %rdi\n\tcallq\tfree@PLT\n\tmovq\t-40(%rbp), %rdi\n\tcallq\tfree@PLT\n\tmovl\t-20(%rbp), %edi\n\tmovq\tnow(%rip), %rcx\n\tmovl\t$4, %esi\n\tleaq\t.L.str.1(%rip), %rdx\n\tcallq\tsnprintf@PLT\n\tcmpq\t$0, -16(%rbp)\n\tje\t.LBB0_2\n# %bb.1:\n\tmovq\t-16(%rbp), %rcx\n\n; <post-context>\n\tleaq\t-20(%rbp), %rdi\n\tmovl\t$4, %esi\n\tmovl\t$1, %edx\n\tcallq\tfwrite@PLT\n\tmovq\t-16(%rbp), %rdi\n\tcallq\tfclose@PLT\n.LBB0_2:\n\taddq\t$48, %rsp\n\tpopq\t%rbp\n\t.cfi_def_cfa %rsp, 8\n\tretq\n.Lfunc_end0:\n\t.size\tArch_Touch, .Lfunc_end0-Arch_Touch\n\t.cfi_endproc\n # -- End function\n\t.type\tARCHIVE,@object # @ARCHIVE\n\t.bss\n\t.globl\tARCHIVE\n\t.p2align\t2, 0x0\nARCHIVE:\n\t.long\t0 # 0x0\n\t.size\tARCHIVE, 4\n\n\t.type\tMEMBER,@object # @MEMBER\n\t.globl\tMEMBER\n\t.p2align\t2, 0x0\nMEMBER:\n\t.long\t0 # 0x0\n\t.size\tMEMBER, 4\n\n\t.type\t.L.str,@object # @.str\n\t.section\t.rodata.str1.1,\"aMS\",@progbits,1\n.L.str:\n\t.asciz\t\"r+\"\n\t.size\t.L.str, 3\n\n\t.type\t.L.str.1,@object # @.str.1\n.L.str.1:\n\t.asciz\t\"%-12ld\"\n\t.size\t.L.str.1, 7\n\n\t.type\tnow,@object # @now\n\t.bss\n\t.globl\tnow\n\t.p2align\t3, 0x0\nnow:\n\t.quad\t0 # 0x0\n\t.size\tnow, 8\n\n\t.ident\t\"Ubuntu clang version 18.1.3 (1ubuntu1)\"\n\t.section\t\".note.GNU-stack\",\"\",@progbits\n\t.addrsig\n\t.addrsig_sym ArchFindMember\n\t.addrsig_sym Var_Value\n\t.addrsig_sym free\n\t.addrsig_sym snprintf\n\t.addrsig_sym fwrite\n\t.addrsig_sym fclose\n\t.addrsig_sym ARCHIVE\n\t.addrsig_sym MEMBER\n\t.addrsig_sym now\n\n```\n\n```armasm\n; <pre-target>\n\t.cfi_startproc\n; %bb.0:\n\tsub\tsp, sp, #64\n\t.cfi_def_cfa_offset 64\n\tstp\tx29, x30, [sp, #48] ; 16-byte Folded Spill\n\tadd\tx29, sp, #48\n\t.cfi_def_cfa w29, 16\n\t.cfi_offset w30, -8\n\t.cfi_offset w29, -16\n\tstur\tx0, [x29, #-8]\n\tadrp\tx8, _ARCHIVE@GOTPAGE\n\tldr\tx8, [x8, _ARCHIVE@GOTPAGEOFF]\n\tldr\tw0, [x8]\n\tldur\tx1, [x29, #-8]\n\tadd\tx2, sp, #16\n\tbl\t_Var_Value\n\tstr\tw0, [sp, #4] ; 4-byte Folded Spill\n\tadrp\tx8, _MEMBER@GOTPAGE\n\tldr\tx8, [x8, _MEMBER@GOTPAGEOFF]\n\tldr\tw0, [x8]\n\tldur\tx1, [x29, #-8]\n\tadd\tx2, sp, #8\n\tbl\t_Var_Value\n\tmov\tx1, x0\n\tldr\tw0, [sp, #4] ; 4-byte Folded Reload\n\tsub\tx2, x29, #20\n\tadrp\tx3, l_.str@PAGE\n\tadd\tx3, x3, l_.str@PAGEOFF\n\tbl\t_ArchFindMember\n\tstur\tx0, [x29, #-16]\n\n```", "role": "user" }, { "content": "```armasm\n\tldr\tx0, [sp, #16]\n\tbl\t_free\n\tldr\tx0, [sp, #8]\n\tbl\t_free\n\tldur\tw0, [x29, #-20]\n\tadrp\tx8, _now@GOTPAGE\n\tldr\tx8, [x8, _now@GOTPAGEOFF]\n\tldr\tx3, [x8]\n\tmov\tw1, #4\n\tadrp\tx2, l_.str.1@PAGE\n\tadd\tx2, x2, l_.str.1@PAGEOFF\n\tbl\t_snprintf\n\tldur\tx8, [x29, #-16]\n\tsubs\tx8, x8, #0\n\tcset\tw8, eq\n\ttbnz\tw8, #0, LBB0_2\n\tb\tLBB0_1\nLBB0_1:\n\tldur\tx3, [x29, #-16]\n\tsub\tx0, x29, #20\n\tmov\tw1, #4\n\tmov\tw2, #1\n```", "role": "assistant" } ]
extr_arch.c_Arch_Touch.c
[ { "content": "You are given an x86 assembly block (<block>) to traspile into armv8_64 assembly.\nYou are also given the context for this block in the form of pre-context (<pre_context>) and post-context (<post_context>).\nThere is also a pre-target-context (<pre_target>) which is the context for the target block. Use the input pre and post context along with the target pre context to transpile the block from x86 to armv8_64.\n\n```x86asm\n; <pre-context>\n\tmovq\tnow(%rip), %rcx\n\tmovl\t$4, %esi\n\tleaq\t.L.str.1(%rip), %rdx\n\tcallq\tsnprintf@PLT\n\tcmpq\t$0, -16(%rbp)\n\tje\t.LBB0_2\n# %bb.1:\n\tmovq\t-16(%rbp), %rcx\n\n; <block>\n\tleaq\t-20(%rbp), %rdi\n\tmovl\t$4, %esi\n\tmovl\t$1, %edx\n\tcallq\tfwrite@PLT\n\tmovq\t-16(%rbp), %rdi\n\tcallq\tfclose@PLT\n.LBB0_2:\n\taddq\t$48, %rsp\n\tpopq\t%rbp\n\t.cfi_def_cfa %rsp, 8\n\tretq\n.Lfunc_end0:\n\t.size\tArch_Touch, .Lfunc_end0-Arch_Touch\n\t.cfi_endproc\n # -- End function\n\t.type\tARCHIVE,@object # @ARCHIVE\n\t.bss\n\t.globl\tARCHIVE\n\t.p2align\t2, 0x0\nARCHIVE:\n\t.long\t0 # 0x0\n\t.size\tARCHIVE, 4\n\n\t.type\tMEMBER,@object # @MEMBER\n\t.globl\tMEMBER\n\t.p2align\t2, 0x0\nMEMBER:\n\t.long\t0 # 0x0\n\t.size\tMEMBER, 4\n\n\t.type\t.L.str,@object # @.str\n\t.section\t.rodata.str1.1,\"aMS\",@progbits,1\n.L.str:\n\t.asciz\t\"r+\"\n\t.size\t.L.str, 3\n\n\t.type\t.L.str.1,@object # @.str.1\n.L.str.1:\n\t.asciz\t\"%-12ld\"\n\t.size\t.L.str.1, 7\n\n\t.type\tnow,@object # @now\n\t.bss\n\t.globl\tnow\n\t.p2align\t3, 0x0\nnow:\n\t.quad\t0 # 0x0\n\t.size\tnow, 8\n\n\t.ident\t\"Ubuntu clang version 18.1.3 (1ubuntu1)\"\n\t.section\t\".note.GNU-stack\",\"\",@progbits\n\t.addrsig\n\t.addrsig_sym ArchFindMember\n\t.addrsig_sym Var_Value\n\t.addrsig_sym free\n\t.addrsig_sym snprintf\n\t.addrsig_sym fwrite\n\t.addrsig_sym fclose\n\t.addrsig_sym ARCHIVE\n\t.addrsig_sym MEMBER\n\t.addrsig_sym now\n\n; <post-context>\n\n```\n\n```armasm\n; <pre-target>\n\t.cfi_startproc\n; %bb.0:\n\tsub\tsp, sp, #64\n\t.cfi_def_cfa_offset 64\n\tstp\tx29, x30, [sp, #48] ; 16-byte Folded Spill\n\tadd\tx29, sp, #48\n\t.cfi_def_cfa w29, 16\n\t.cfi_offset w30, -8\n\t.cfi_offset w29, -16\n\tstur\tx0, [x29, #-8]\n\tadrp\tx8, _ARCHIVE@GOTPAGE\n\tldr\tx8, [x8, _ARCHIVE@GOTPAGEOFF]\n\tldr\tw0, [x8]\n\tldur\tx1, [x29, #-8]\n\tadd\tx2, sp, #16\n\tbl\t_Var_Value\n\tstr\tw0, [sp, #4] ; 4-byte Folded Spill\n\tadrp\tx8, _MEMBER@GOTPAGE\n\tldr\tx8, [x8, _MEMBER@GOTPAGEOFF]\n\tldr\tw0, [x8]\n\tldur\tx1, [x29, #-8]\n\tadd\tx2, sp, #8\n\tbl\t_Var_Value\n\tmov\tx1, x0\n\tldr\tw0, [sp, #4] ; 4-byte Folded Reload\n\tsub\tx2, x29, #20\n\tadrp\tx3, l_.str@PAGE\n\tadd\tx3, x3, l_.str@PAGEOFF\n\tbl\t_ArchFindMember\n\tstur\tx0, [x29, #-16]\n\tldr\tx0, [sp, #16]\n\tbl\t_free\n\tldr\tx0, [sp, #8]\n\tbl\t_free\n\tldur\tw0, [x29, #-20]\n\tadrp\tx8, _now@GOTPAGE\n\tldr\tx8, [x8, _now@GOTPAGEOFF]\n\tldr\tx3, [x8]\n\tmov\tw1, #4\n\tadrp\tx2, l_.str.1@PAGE\n\tadd\tx2, x2, l_.str.1@PAGEOFF\n\tbl\t_snprintf\n\tldur\tx8, [x29, #-16]\n\tsubs\tx8, x8, #0\n\tcset\tw8, eq\n\ttbnz\tw8, #0, LBB0_2\n\tb\tLBB0_1\nLBB0_1:\n\tldur\tx3, [x29, #-16]\n\tsub\tx0, x29, #20\n\tmov\tw1, #4\n\tmov\tw2, #1\n\n```", "role": "user" }, { "content": "```armasm\n\tbl\t_fwrite\n\tldur\tx0, [x29, #-16]\n\tbl\t_fclose\n\tb\tLBB0_2\nLBB0_2:\n\tldp\tx29, x30, [sp, #48] ; 16-byte Folded Reload\n\tadd\tsp, sp, #64\n\tret\n\t.cfi_endproc\n ; -- End function\n\t.comm\t_ARCHIVE,4,2 ; @ARCHIVE\n\t.comm\t_MEMBER,4,2 ; @MEMBER\n\t.section\t__TEXT,__cstring,cstring_literals\nl_.str: ; @.str\n\t.asciz\t\"r+\"\n\nl_.str.1: ; @.str.1\n\t.asciz\t\"%-12ld\"\n\n\t.comm\t_now,8,3 ; @now\n.subsections_via_symbols\n```", "role": "assistant" } ]
extr_33193.c_process_cmds.c
[ { "content": "You are given an x86 assembly block (<block>) to traspile into armv8_64 assembly.\nYou are also given the context for this block in the form of pre-context (<pre_context>) and post-context (<post_context>).\nThere is also a pre-target-context (<pre_target>) which is the context for the target block. Use the input pre and post context along with the target pre context to transpile the block from x86 to armv8_64.\n\n```x86asm\n; <pre-context>\n\n; <block>\n\t.text\n\t.file\t\"extr_33193.c_process_cmds.c\"\n\t.p2align\t4, 0x90 # -- Begin function process_cmds\n\t.type\tprocess_cmds,@function\nprocess_cmds: # @process_cmds\n\t.cfi_startproc\n# %bb.0:\n\tpushq\t%rbp\n\t.cfi_def_cfa_offset 16\n\t.cfi_offset %rbp, -16\n\tmovq\t%rsp, %rbp\n\t.cfi_def_cfa_register %rbp\n\tsubq\t$32, %rsp\n\tleaq\t-4(%rbp), %rdi\n\tcallq\tsigemptyset@PLT\n\tmovl\tSIGINT(%rip), %esi\n\tleaq\t-4(%rbp), %rdi\n\tcallq\tsigaddset@PLT\n\tmovl\tSIG_BLOCK(%rip), %edi\n\tleaq\t-4(%rbp), %rsi\n\txorl\t%eax, %eax\n\tmovl\t%eax, %edx\n\tcallq\tsigprocmask@PLT\n\tleaq\t-24(%rbp), %rdi\n\tmovl\t$16, %esi\n\txorl\t%edx, %edx\n\tcallq\tmemset@PLT\n\tleaq\tsigint_handler(%rip), %rax\n\tmovq\t%rax, -16(%rbp)\n\tmovl\tSA_NODEFER(%rip), %eax\n\n; <post-context>\n\tmovl\t%eax, -24(%rbp)\n\tmovl\tSIGINT(%rip), %edi\n\tleaq\t-24(%rbp), %rsi\n\txorl\t%eax, %eax\n\tmovl\t%eax, %edx\n\tcallq\tsigaction@PLT\n\tmovl\tSIG_UNBLOCK(%rip), %edi\n\tleaq\t-4(%rbp), %rsi\n\txorl\t%eax, %eax\n\tmovl\t%eax, %edx\n\tcallq\tsigprocmask@PLT\n.LBB0_1: # =>This Inner Loop Header: Depth=1\n\n```\n\n```armasm\n; <pre-target>\n\n```", "role": "user" }, { "content": "```armasm\n\t.section\t__TEXT,__text,regular,pure_instructions\n\t.build_version macos, 13, 0\tsdk_version 13, 3\n\t.p2align\t2 ; -- Begin function process_cmds\n_process_cmds: ; @process_cmds\n\t.cfi_startproc\n; %bb.0:\n\tsub\tsp, sp, #80\n\t.cfi_def_cfa_offset 80\n\tstp\tx29, x30, [sp, #64] ; 16-byte Folded Spill\n\tadd\tx29, sp, #64\n\t.cfi_def_cfa w29, 16\n\t.cfi_offset w30, -8\n\t.cfi_offset w29, -16\n\tsub\tx0, x29, #4\n\tstr\tx0, [sp, #24] ; 8-byte Folded Spill\n\tbl\t_sigemptyset\n\tldr\tx0, [sp, #24] ; 8-byte Folded Reload\n\tadrp\tx8, _SIGINT@GOTPAGE\n\tldr\tx8, [x8, _SIGINT@GOTPAGEOFF]\n\tstr\tx8, [sp, #8] ; 8-byte Folded Spill\n\tldr\tw1, [x8]\n\tbl\t_sigaddset\n\tldr\tx1, [sp, #24] ; 8-byte Folded Reload\n\tadrp\tx8, _SIG_BLOCK@GOTPAGE\n\tldr\tx8, [x8, _SIG_BLOCK@GOTPAGEOFF]\n\tldr\tw0, [x8]\n\tmov\tx2, #0\n\tstr\tx2, [sp, #32] ; 8-byte Folded Spill\n\tbl\t_sigprocmask\n\tsub\tx0, x29, #24\n\tstr\tx0, [sp, #16] ; 8-byte Folded Spill\n\tmov\tw1, #16\n\tmov\tw2, #0\n\tbl\t_memset\n\tldr\tx8, [sp, #8] ; 8-byte Folded Reload\n\tldr\tx1, [sp, #16] ; 8-byte Folded Reload\n\tldr\tx2, [sp, #32] ; 8-byte Folded Reload\n\tadrp\tx9, _sigint_handler@GOTPAGE\n\tldr\tx9, [x9, _sigint_handler@GOTPAGEOFF]\n\tstur\tx9, [x29, #-16]\n\tadrp\tx9, _SA_NODEFER@GOTPAGE\n\tldr\tx9, [x9, _SA_NODEFER@GOTPAGEOFF]\n\tldr\tw9, [x9]\n```", "role": "assistant" } ]
extr_33193.c_process_cmds.c
[ { "content": "You are given an x86 assembly block (<block>) to traspile into armv8_64 assembly.\nYou are also given the context for this block in the form of pre-context (<pre_context>) and post-context (<post_context>).\nThere is also a pre-target-context (<pre_target>) which is the context for the target block. Use the input pre and post context along with the target pre context to transpile the block from x86 to armv8_64.\n\n```x86asm\n; <pre-context>\n\tmovl\tSIG_BLOCK(%rip), %edi\n\tleaq\t-4(%rbp), %rsi\n\txorl\t%eax, %eax\n\tmovl\t%eax, %edx\n\tcallq\tsigprocmask@PLT\n\tleaq\t-24(%rbp), %rdi\n\tmovl\t$16, %esi\n\txorl\t%edx, %edx\n\tcallq\tmemset@PLT\n\tleaq\tsigint_handler(%rip), %rax\n\tmovq\t%rax, -16(%rbp)\n\tmovl\tSA_NODEFER(%rip), %eax\n\n; <block>\n\tmovl\t%eax, -24(%rbp)\n\tmovl\tSIGINT(%rip), %edi\n\tleaq\t-24(%rbp), %rsi\n\txorl\t%eax, %eax\n\tmovl\t%eax, %edx\n\tcallq\tsigaction@PLT\n\tmovl\tSIG_UNBLOCK(%rip), %edi\n\tleaq\t-4(%rbp), %rsi\n\txorl\t%eax, %eax\n\tmovl\t%eax, %edx\n\tcallq\tsigprocmask@PLT\n.LBB0_1: # =>This Inner Loop Header: Depth=1\n\tmovb\t$0, %al\n\tcallq\tprocess_cmd@PLT\n\tjmp\t.LBB0_1\n.Lfunc_end0:\n\t.size\tprocess_cmds, .Lfunc_end0-process_cmds\n\t.cfi_endproc\n # -- End function\n\t.type\tSIGINT,@object # @SIGINT\n\t.bss\n\t.globl\tSIGINT\n\t.p2align\t2, 0x0\nSIGINT:\n\t.long\t0 # 0x0\n\t.size\tSIGINT, 4\n\n\t.type\tSIG_BLOCK,@object # @SIG_BLOCK\n\t.globl\tSIG_BLOCK\n\t.p2align\t2, 0x0\nSIG_BLOCK:\n\t.long\t0 # 0x0\n\t.size\tSIG_BLOCK, 4\n\n\t.type\tsigint_handler,@object # @sigint_handler\n\t.globl\tsigint_handler\n\t.p2align\t2, 0x0\nsigint_handler:\n\t.long\t0 # 0x0\n\t.size\tsigint_handler, 4\n\n\t.type\tSA_NODEFER,@object # @SA_NODEFER\n\t.globl\tSA_NODEFER\n\t.p2align\t2, 0x0\nSA_NODEFER:\n\t.long\t0 # 0x0\n\t.size\tSA_NODEFER, 4\n\n\t.type\tSIG_UNBLOCK,@object # @SIG_UNBLOCK\n\t.globl\tSIG_UNBLOCK\n\t.p2align\t2, 0x0\nSIG_UNBLOCK:\n\t.long\t0 # 0x0\n\t.size\tSIG_UNBLOCK, 4\n\n\t.type\tsigint_dest,@object # @sigint_dest\n\t.globl\tsigint_dest\n\t.p2align\t2, 0x0\nsigint_dest:\n\t.long\t0 # 0x0\n\t.size\tsigint_dest, 4\n\n\t.type\tstdout,@object # @stdout\n\t.globl\tstdout\n\t.p2align\t2, 0x0\nstdout:\n\t.long\t0 # 0x0\n\t.size\tstdout, 4\n\n\t.ident\t\"Ubuntu clang version 18.1.3 (1ubuntu1)\"\n\t.section\t\".note.GNU-stack\",\"\",@progbits\n\t.addrsig\n\t.addrsig_sym process_cmds\n\t.addrsig_sym sigemptyset\n\t.addrsig_sym sigaddset\n\t.addrsig_sym sigprocmask\n\t.addrsig_sym memset\n\t.addrsig_sym sigaction\n\t.addrsig_sym process_cmd\n\t.addrsig_sym SIGINT\n\t.addrsig_sym SIG_BLOCK\n\t.addrsig_sym sigint_handler\n\t.addrsig_sym SA_NODEFER\n\t.addrsig_sym SIG_UNBLOCK\n\n; <post-context>\n\n```\n\n```armasm\n; <pre-target>\n\t.cfi_startproc\n; %bb.0:\n\tsub\tsp, sp, #80\n\t.cfi_def_cfa_offset 80\n\tstp\tx29, x30, [sp, #64] ; 16-byte Folded Spill\n\tadd\tx29, sp, #64\n\t.cfi_def_cfa w29, 16\n\t.cfi_offset w30, -8\n\t.cfi_offset w29, -16\n\tsub\tx0, x29, #4\n\tstr\tx0, [sp, #24] ; 8-byte Folded Spill\n\tbl\t_sigemptyset\n\tldr\tx0, [sp, #24] ; 8-byte Folded Reload\n\tadrp\tx8, _SIGINT@GOTPAGE\n\tldr\tx8, [x8, _SIGINT@GOTPAGEOFF]\n\tstr\tx8, [sp, #8] ; 8-byte Folded Spill\n\tldr\tw1, [x8]\n\tbl\t_sigaddset\n\tldr\tx1, [sp, #24] ; 8-byte Folded Reload\n\tadrp\tx8, _SIG_BLOCK@GOTPAGE\n\tldr\tx8, [x8, _SIG_BLOCK@GOTPAGEOFF]\n\tldr\tw0, [x8]\n\tmov\tx2, #0\n\tstr\tx2, [sp, #32] ; 8-byte Folded Spill\n\tbl\t_sigprocmask\n\tsub\tx0, x29, #24\n\tstr\tx0, [sp, #16] ; 8-byte Folded Spill\n\tmov\tw1, #16\n\tmov\tw2, #0\n\tbl\t_memset\n\tldr\tx8, [sp, #8] ; 8-byte Folded Reload\n\tldr\tx1, [sp, #16] ; 8-byte Folded Reload\n\tldr\tx2, [sp, #32] ; 8-byte Folded Reload\n\tadrp\tx9, _sigint_handler@GOTPAGE\n\tldr\tx9, [x9, _sigint_handler@GOTPAGEOFF]\n\tstur\tx9, [x29, #-16]\n\tadrp\tx9, _SA_NODEFER@GOTPAGE\n\tldr\tx9, [x9, _SA_NODEFER@GOTPAGEOFF]\n\tldr\tw9, [x9]\n\n```", "role": "user" }, { "content": "```armasm\n\tstur\tw9, [x29, #-24]\n\tldr\tw0, [x8]\n\tbl\t_sigaction\n\tldr\tx1, [sp, #24] ; 8-byte Folded Reload\n\tldr\tx2, [sp, #32] ; 8-byte Folded Reload\n\tadrp\tx8, _SIG_UNBLOCK@GOTPAGE\n\tldr\tx8, [x8, _SIG_UNBLOCK@GOTPAGEOFF]\n\tldr\tw0, [x8]\n\tbl\t_sigprocmask\n\tb\tLBB0_1\nLBB0_1: ; =>This Inner Loop Header: Depth=1\n\tbl\t_process_cmd\n\tb\tLBB0_1\n\t.cfi_endproc\n ; -- End function\n\t.comm\t_SIGINT,4,2 ; @SIGINT\n\t.comm\t_SIG_BLOCK,4,2 ; @SIG_BLOCK\n\t.comm\t_sigint_handler,4,2 ; @sigint_handler\n\t.comm\t_SA_NODEFER,4,2 ; @SA_NODEFER\n\t.comm\t_SIG_UNBLOCK,4,2 ; @SIG_UNBLOCK\n\t.comm\t_sigint_dest,4,2 ; @sigint_dest\n\t.comm\t_stdout,4,2 ; @stdout\n\t.no_dead_strip\t_process_cmds\n.subsections_via_symbols\n```", "role": "assistant" } ]
extr_atmel_serial.c_atmel_rx_chars.c
[ { "content": "You are given an x86 assembly block (<block>) to traspile into armv8_64 assembly.\nYou are also given the context for this block in the form of pre-context (<pre_context>) and post-context (<post_context>).\nThere is also a pre-target-context (<pre_target>) which is the context for the target block. Use the input pre and post context along with the target pre context to transpile the block from x86 to armv8_64.\n\n```x86asm\n; <pre-context>\n\n; <block>\n\t.text\n\t.file\t\"extr_atmel_serial.c_atmel_rx_chars.c\"\n\t.p2align\t4, 0x90 # -- Begin function atmel_rx_chars\n\t.type\tatmel_rx_chars,@function\natmel_rx_chars: # @atmel_rx_chars\n\t.cfi_startproc\n# %bb.0:\n\tpushq\t%rbp\n\t.cfi_def_cfa_offset 16\n\t.cfi_offset %rbp, -16\n\tmovq\t%rsp, %rbp\n\t.cfi_def_cfa_register %rbp\n\tsubq\t$32, %rsp\n\tmovq\t%rdi, -8(%rbp)\n\tmovq\t-8(%rbp), %rdi\n\tcallq\tto_atmel_uart_port@PLT\n\tmovq\t%rax, -16(%rbp)\n\tmovq\t-8(%rbp), %rdi\n\tcallq\tUART_GET_CSR@PLT\n\tmovl\t%eax, -20(%rbp)\n.LBB0_1: # =>This Inner Loop Header: Depth=1\n\tmovl\t-20(%rbp), %eax\n\tandl\tATMEL_US_RXRDY(%rip), %eax\n\tcmpl\t$0, %eax\n\tje\t.LBB0_11\n# %bb.2: # in Loop: Header=BB0_1 Depth=1\n\n; <post-context>\n\tmovq\t-8(%rbp), %rdi\n\tcallq\tUART_GET_CHAR@PLT\n\tmovl\t%eax, -24(%rbp)\n\tmovl\t-20(%rbp), %ecx\n\tmovl\tATMEL_US_PARE(%rip), %eax\n\n```\n\n```armasm\n; <pre-target>\n\n```", "role": "user" }, { "content": "```armasm\n\t.section\t__TEXT,__text,regular,pure_instructions\n\t.build_version macos, 13, 0\tsdk_version 13, 3\n\t.p2align\t2 ; -- Begin function atmel_rx_chars\n_atmel_rx_chars: ; @atmel_rx_chars\n\t.cfi_startproc\n; %bb.0:\n\tsub\tsp, sp, #64\n\t.cfi_def_cfa_offset 64\n\tstp\tx29, x30, [sp, #48] ; 16-byte Folded Spill\n\tadd\tx29, sp, #48\n\t.cfi_def_cfa w29, 16\n\t.cfi_offset w30, -8\n\t.cfi_offset w29, -16\n\tadrp\tx8, _ATMEL_US_RXBRK@GOTPAGE\n\tldr\tx8, [x8, _ATMEL_US_RXBRK@GOTPAGEOFF]\n\tstr\tx8, [sp, #16] ; 8-byte Folded Spill\n\tstur\tx0, [x29, #-8]\n\tldur\tx0, [x29, #-8]\n\tbl\t_to_atmel_uart_port\n\tstur\tx0, [x29, #-16]\n\tldur\tx0, [x29, #-8]\n\tbl\t_UART_GET_CSR\n\tstur\tw0, [x29, #-20]\n\tb\tLBB0_1\nLBB0_1: ; =>This Inner Loop Header: Depth=1\n\tldur\tw8, [x29, #-20]\n\tadrp\tx9, _ATMEL_US_RXRDY@GOTPAGE\n\tldr\tx9, [x9, _ATMEL_US_RXRDY@GOTPAGEOFF]\n\tldr\tw9, [x9]\n\tands\tw8, w8, w9\n\tcset\tw8, eq\n\ttbnz\tw8, #0, LBB0_11\n\tb\tLBB0_2\nLBB0_2: ; in Loop: Header=BB0_1 Depth=1\n```", "role": "assistant" } ]
extr_atmel_serial.c_atmel_rx_chars.c
[ { "content": "You are given an x86 assembly block (<block>) to traspile into armv8_64 assembly.\nYou are also given the context for this block in the form of pre-context (<pre_context>) and post-context (<post_context>).\nThere is also a pre-target-context (<pre_target>) which is the context for the target block. Use the input pre and post context along with the target pre context to transpile the block from x86 to armv8_64.\n\n```x86asm\n; <pre-context>\n\tmovq\t-8(%rbp), %rdi\n\tcallq\tUART_GET_CSR@PLT\n\tmovl\t%eax, -20(%rbp)\n.LBB0_1: # =>This Inner Loop Header: Depth=1\n\tmovl\t-20(%rbp), %eax\n\tandl\tATMEL_US_RXRDY(%rip), %eax\n\tcmpl\t$0, %eax\n\tje\t.LBB0_11\n# %bb.2: # in Loop: Header=BB0_1 Depth=1\n\n; <block>\n\tmovq\t-8(%rbp), %rdi\n\tcallq\tUART_GET_CHAR@PLT\n\tmovl\t%eax, -24(%rbp)\n\tmovl\t-20(%rbp), %ecx\n\tmovl\tATMEL_US_PARE(%rip), %eax\n\torl\tATMEL_US_FRAME(%rip), %eax\n\torl\tATMEL_US_OVRE(%rip), %eax\n\torl\tATMEL_US_RXBRK(%rip), %eax\n\tandl\t%eax, %ecx\n\tmovb\t$1, %al\n\tcmpl\t$0, %ecx\n\tmovb\t%al, -25(%rbp) # 1-byte Spill\n\tjne\t.LBB0_4\n# %bb.3: # in Loop: Header=BB0_1 Depth=1\n\n; <post-context>\n\tmovq\t-16(%rbp), %rax\n\tcmpl\t$0, (%rax)\n\tsetne\t%al\n\tmovb\t%al, -25(%rbp) # 1-byte Spill\n.LBB0_4: # in Loop: Header=BB0_1 Depth=1\n\tmovb\t-25(%rbp), %al # 1-byte Reload\n\tandb\t$1, %al\n\tmovzbl\t%al, %edi\n\tcallq\tunlikely@PLT\n\tcmpq\t$0, %rax\n\n```\n\n```armasm\n; <pre-target>\n\t.cfi_startproc\n; %bb.0:\n\tsub\tsp, sp, #64\n\t.cfi_def_cfa_offset 64\n\tstp\tx29, x30, [sp, #48] ; 16-byte Folded Spill\n\tadd\tx29, sp, #48\n\t.cfi_def_cfa w29, 16\n\t.cfi_offset w30, -8\n\t.cfi_offset w29, -16\n\tadrp\tx8, _ATMEL_US_RXBRK@GOTPAGE\n\tldr\tx8, [x8, _ATMEL_US_RXBRK@GOTPAGEOFF]\n\tstr\tx8, [sp, #16] ; 8-byte Folded Spill\n\tstur\tx0, [x29, #-8]\n\tldur\tx0, [x29, #-8]\n\tbl\t_to_atmel_uart_port\n\tstur\tx0, [x29, #-16]\n\tldur\tx0, [x29, #-8]\n\tbl\t_UART_GET_CSR\n\tstur\tw0, [x29, #-20]\n\tb\tLBB0_1\nLBB0_1: ; =>This Inner Loop Header: Depth=1\n\tldur\tw8, [x29, #-20]\n\tadrp\tx9, _ATMEL_US_RXRDY@GOTPAGE\n\tldr\tx9, [x9, _ATMEL_US_RXRDY@GOTPAGEOFF]\n\tldr\tw9, [x9]\n\tands\tw8, w8, w9\n\tcset\tw8, eq\n\ttbnz\tw8, #0, LBB0_11\n\tb\tLBB0_2\nLBB0_2: ; in Loop: Header=BB0_1 Depth=1\n\n```", "role": "user" }, { "content": "```armasm\n\tldur\tx0, [x29, #-8]\n\tbl\t_UART_GET_CHAR\n\tldr\tx10, [sp, #16] ; 8-byte Folded Reload\n\tstr\tw0, [sp, #24]\n\tldur\tw8, [x29, #-20]\n\tadrp\tx9, _ATMEL_US_PARE@GOTPAGE\n\tldr\tx9, [x9, _ATMEL_US_PARE@GOTPAGEOFF]\n\tldr\tw9, [x9]\n\tadrp\tx11, _ATMEL_US_FRAME@GOTPAGE\n\tldr\tx11, [x11, _ATMEL_US_FRAME@GOTPAGEOFF]\n\tldr\tw11, [x11]\n\torr\tw9, w9, w11\n\tadrp\tx11, _ATMEL_US_OVRE@GOTPAGE\n\tldr\tx11, [x11, _ATMEL_US_OVRE@GOTPAGEOFF]\n\tldr\tw11, [x11]\n\torr\tw9, w9, w11\n\tldr\tw10, [x10]\n\torr\tw9, w9, w10\n\tands\tw8, w8, w9\n\tcset\tw8, ne\n\tmov\tw9, #1\n\tstr\tw9, [sp, #12] ; 4-byte Folded Spill\n\ttbnz\tw8, #0, LBB0_4\n\tb\tLBB0_3\nLBB0_3: ; in Loop: Header=BB0_1 Depth=1\n```", "role": "assistant" } ]
extr_atmel_serial.c_atmel_rx_chars.c
[ { "content": "You are given an x86 assembly block (<block>) to traspile into armv8_64 assembly.\nYou are also given the context for this block in the form of pre-context (<pre_context>) and post-context (<post_context>).\nThere is also a pre-target-context (<pre_target>) which is the context for the target block. Use the input pre and post context along with the target pre context to transpile the block from x86 to armv8_64.\n\n```x86asm\n; <pre-context>\n\torl\tATMEL_US_FRAME(%rip), %eax\n\torl\tATMEL_US_OVRE(%rip), %eax\n\torl\tATMEL_US_RXBRK(%rip), %eax\n\tandl\t%eax, %ecx\n\tmovb\t$1, %al\n\tcmpl\t$0, %ecx\n\tmovb\t%al, -25(%rbp) # 1-byte Spill\n\tjne\t.LBB0_4\n# %bb.3: # in Loop: Header=BB0_1 Depth=1\n\n; <block>\n\tmovq\t-16(%rbp), %rax\n\tcmpl\t$0, (%rax)\n\tsetne\t%al\n\tmovb\t%al, -25(%rbp) # 1-byte Spill\n.LBB0_4: # in Loop: Header=BB0_1 Depth=1\n\tmovb\t-25(%rbp), %al # 1-byte Reload\n\tandb\t$1, %al\n\tmovzbl\t%al, %edi\n\tcallq\tunlikely@PLT\n\tcmpq\t$0, %rax\n\tje\t.LBB0_10\n# %bb.5: # in Loop: Header=BB0_1 Depth=1\n\tmovq\t-8(%rbp), %rdi\n\tmovl\tATMEL_US_RSTSTA(%rip), %esi\n\tcallq\tUART_PUT_CR@PLT\n\tmovl\t-20(%rbp), %eax\n\n; <post-context>\n\tandl\tATMEL_US_RXBRK(%rip), %eax\n\tcmpl\t$0, %eax\n\tje\t.LBB0_8\n# %bb.6: # in Loop: Header=BB0_1 Depth=1\n\tmovq\t-16(%rbp), %rax\n\tcmpl\t$0, (%rax)\n\tjne\t.LBB0_8\n# %bb.7: # in Loop: Header=BB0_1 Depth=1\n\tmovq\t-16(%rbp), %rax\n\n```\n\n```armasm\n; <pre-target>\n\t.cfi_startproc\n; %bb.0:\n\tsub\tsp, sp, #64\n\t.cfi_def_cfa_offset 64\n\tstp\tx29, x30, [sp, #48] ; 16-byte Folded Spill\n\tadd\tx29, sp, #48\n\t.cfi_def_cfa w29, 16\n\t.cfi_offset w30, -8\n\t.cfi_offset w29, -16\n\tadrp\tx8, _ATMEL_US_RXBRK@GOTPAGE\n\tldr\tx8, [x8, _ATMEL_US_RXBRK@GOTPAGEOFF]\n\tstr\tx8, [sp, #16] ; 8-byte Folded Spill\n\tstur\tx0, [x29, #-8]\n\tldur\tx0, [x29, #-8]\n\tbl\t_to_atmel_uart_port\n\tstur\tx0, [x29, #-16]\n\tldur\tx0, [x29, #-8]\n\tbl\t_UART_GET_CSR\n\tstur\tw0, [x29, #-20]\n\tb\tLBB0_1\nLBB0_1: ; =>This Inner Loop Header: Depth=1\n\tldur\tw8, [x29, #-20]\n\tadrp\tx9, _ATMEL_US_RXRDY@GOTPAGE\n\tldr\tx9, [x9, _ATMEL_US_RXRDY@GOTPAGEOFF]\n\tldr\tw9, [x9]\n\tands\tw8, w8, w9\n\tcset\tw8, eq\n\ttbnz\tw8, #0, LBB0_11\n\tb\tLBB0_2\nLBB0_2: ; in Loop: Header=BB0_1 Depth=1\n\tldur\tx0, [x29, #-8]\n\tbl\t_UART_GET_CHAR\n\tldr\tx10, [sp, #16] ; 8-byte Folded Reload\n\tstr\tw0, [sp, #24]\n\tldur\tw8, [x29, #-20]\n\tadrp\tx9, _ATMEL_US_PARE@GOTPAGE\n\tldr\tx9, [x9, _ATMEL_US_PARE@GOTPAGEOFF]\n\tldr\tw9, [x9]\n\tadrp\tx11, _ATMEL_US_FRAME@GOTPAGE\n\tldr\tx11, [x11, _ATMEL_US_FRAME@GOTPAGEOFF]\n\tldr\tw11, [x11]\n\torr\tw9, w9, w11\n\tadrp\tx11, _ATMEL_US_OVRE@GOTPAGE\n\tldr\tx11, [x11, _ATMEL_US_OVRE@GOTPAGEOFF]\n\tldr\tw11, [x11]\n\torr\tw9, w9, w11\n\tldr\tw10, [x10]\n\torr\tw9, w9, w10\n\tands\tw8, w8, w9\n\tcset\tw8, ne\n\tmov\tw9, #1\n\tstr\tw9, [sp, #12] ; 4-byte Folded Spill\n\ttbnz\tw8, #0, LBB0_4\n\tb\tLBB0_3\nLBB0_3: ; in Loop: Header=BB0_1 Depth=1\n\n```", "role": "user" }, { "content": "```armasm\n\tldur\tx8, [x29, #-16]\n\tldr\tw8, [x8]\n\tsubs\tw8, w8, #0\n\tcset\tw8, ne\n\tstr\tw8, [sp, #12] ; 4-byte Folded Spill\n\tb\tLBB0_4\nLBB0_4: ; in Loop: Header=BB0_1 Depth=1\n\tldr\tw8, [sp, #12] ; 4-byte Folded Reload\n\tand\tw0, w8, #0x1\n\tbl\t_unlikely\n\tsubs\tx8, x0, #0\n\tcset\tw8, eq\n\ttbnz\tw8, #0, LBB0_10\n\tb\tLBB0_5\nLBB0_5: ; in Loop: Header=BB0_1 Depth=1\n\tldur\tx0, [x29, #-8]\n\tadrp\tx8, _ATMEL_US_RSTSTA@GOTPAGE\n\tldr\tx8, [x8, _ATMEL_US_RSTSTA@GOTPAGEOFF]\n\tldr\tw1, [x8]\n\tbl\t_UART_PUT_CR\n\tldr\tx9, [sp, #16] ; 8-byte Folded Reload\n\tldur\tw8, [x29, #-20]\n\tldr\tw9, [x9]\n```", "role": "assistant" } ]
extr_atmel_serial.c_atmel_rx_chars.c
[ { "content": "You are given an x86 assembly block (<block>) to traspile into armv8_64 assembly.\nYou are also given the context for this block in the form of pre-context (<pre_context>) and post-context (<post_context>).\nThere is also a pre-target-context (<pre_target>) which is the context for the target block. Use the input pre and post context along with the target pre context to transpile the block from x86 to armv8_64.\n\n```x86asm\n; <pre-context>\n\tje\t.LBB0_10\n# %bb.5: # in Loop: Header=BB0_1 Depth=1\n\tmovq\t-8(%rbp), %rdi\n\tmovl\tATMEL_US_RSTSTA(%rip), %esi\n\tcallq\tUART_PUT_CR@PLT\n\tmovl\t-20(%rbp), %eax\n\n; <block>\n\tandl\tATMEL_US_RXBRK(%rip), %eax\n\tcmpl\t$0, %eax\n\tje\t.LBB0_8\n# %bb.6: # in Loop: Header=BB0_1 Depth=1\n\tmovq\t-16(%rbp), %rax\n\tcmpl\t$0, (%rax)\n\tjne\t.LBB0_8\n# %bb.7: # in Loop: Header=BB0_1 Depth=1\n\tmovq\t-16(%rbp), %rax\n\tmovl\t$1, (%rax)\n\tmovq\t-8(%rbp), %rdi\n\tmovl\tATMEL_US_RXBRK(%rip), %esi\n\tcallq\tUART_PUT_IER@PLT\n\tjmp\t.LBB0_9\n.LBB0_8: # in Loop: Header=BB0_1 Depth=1\n\n; <post-context>\n\tmovq\t-8(%rbp), %rdi\n\tmovl\tATMEL_US_RXBRK(%rip), %esi\n\tcallq\tUART_PUT_IDR@PLT\n\tmovl\tATMEL_US_RXBRK(%rip), %eax\n\txorl\t$-1, %eax\n\tandl\t-20(%rbp), %eax\n\tmovl\t%eax, -20(%rbp)\n\n```\n\n```armasm\n; <pre-target>\n\t.cfi_startproc\n; %bb.0:\n\tsub\tsp, sp, #64\n\t.cfi_def_cfa_offset 64\n\tstp\tx29, x30, [sp, #48] ; 16-byte Folded Spill\n\tadd\tx29, sp, #48\n\t.cfi_def_cfa w29, 16\n\t.cfi_offset w30, -8\n\t.cfi_offset w29, -16\n\tadrp\tx8, _ATMEL_US_RXBRK@GOTPAGE\n\tldr\tx8, [x8, _ATMEL_US_RXBRK@GOTPAGEOFF]\n\tstr\tx8, [sp, #16] ; 8-byte Folded Spill\n\tstur\tx0, [x29, #-8]\n\tldur\tx0, [x29, #-8]\n\tbl\t_to_atmel_uart_port\n\tstur\tx0, [x29, #-16]\n\tldur\tx0, [x29, #-8]\n\tbl\t_UART_GET_CSR\n\tstur\tw0, [x29, #-20]\n\tb\tLBB0_1\nLBB0_1: ; =>This Inner Loop Header: Depth=1\n\tldur\tw8, [x29, #-20]\n\tadrp\tx9, _ATMEL_US_RXRDY@GOTPAGE\n\tldr\tx9, [x9, _ATMEL_US_RXRDY@GOTPAGEOFF]\n\tldr\tw9, [x9]\n\tands\tw8, w8, w9\n\tcset\tw8, eq\n\ttbnz\tw8, #0, LBB0_11\n\tb\tLBB0_2\nLBB0_2: ; in Loop: Header=BB0_1 Depth=1\n\tldur\tx0, [x29, #-8]\n\tbl\t_UART_GET_CHAR\n\tldr\tx10, [sp, #16] ; 8-byte Folded Reload\n\tstr\tw0, [sp, #24]\n\tldur\tw8, [x29, #-20]\n\tadrp\tx9, _ATMEL_US_PARE@GOTPAGE\n\tldr\tx9, [x9, _ATMEL_US_PARE@GOTPAGEOFF]\n\tldr\tw9, [x9]\n\tadrp\tx11, _ATMEL_US_FRAME@GOTPAGE\n\tldr\tx11, [x11, _ATMEL_US_FRAME@GOTPAGEOFF]\n\tldr\tw11, [x11]\n\torr\tw9, w9, w11\n\tadrp\tx11, _ATMEL_US_OVRE@GOTPAGE\n\tldr\tx11, [x11, _ATMEL_US_OVRE@GOTPAGEOFF]\n\tldr\tw11, [x11]\n\torr\tw9, w9, w11\n\tldr\tw10, [x10]\n\torr\tw9, w9, w10\n\tands\tw8, w8, w9\n\tcset\tw8, ne\n\tmov\tw9, #1\n\tstr\tw9, [sp, #12] ; 4-byte Folded Spill\n\ttbnz\tw8, #0, LBB0_4\n\tb\tLBB0_3\nLBB0_3: ; in Loop: Header=BB0_1 Depth=1\n\tldur\tx8, [x29, #-16]\n\tldr\tw8, [x8]\n\tsubs\tw8, w8, #0\n\tcset\tw8, ne\n\tstr\tw8, [sp, #12] ; 4-byte Folded Spill\n\tb\tLBB0_4\nLBB0_4: ; in Loop: Header=BB0_1 Depth=1\n\tldr\tw8, [sp, #12] ; 4-byte Folded Reload\n\tand\tw0, w8, #0x1\n\tbl\t_unlikely\n\tsubs\tx8, x0, #0\n\tcset\tw8, eq\n\ttbnz\tw8, #0, LBB0_10\n\tb\tLBB0_5\nLBB0_5: ; in Loop: Header=BB0_1 Depth=1\n\tldur\tx0, [x29, #-8]\n\tadrp\tx8, _ATMEL_US_RSTSTA@GOTPAGE\n\tldr\tx8, [x8, _ATMEL_US_RSTSTA@GOTPAGEOFF]\n\tldr\tw1, [x8]\n\tbl\t_UART_PUT_CR\n\tldr\tx9, [sp, #16] ; 8-byte Folded Reload\n\tldur\tw8, [x29, #-20]\n\tldr\tw9, [x9]\n\n```", "role": "user" }, { "content": "```armasm\n\tands\tw8, w8, w9\n\tcset\tw8, eq\n\ttbnz\tw8, #0, LBB0_8\n\tb\tLBB0_6\nLBB0_6: ; in Loop: Header=BB0_1 Depth=1\n\tldur\tx8, [x29, #-16]\n\tldr\tw8, [x8]\n\tsubs\tw8, w8, #0\n\tcset\tw8, ne\n\ttbnz\tw8, #0, LBB0_8\n\tb\tLBB0_7\nLBB0_7: ; in Loop: Header=BB0_1 Depth=1\n\tldr\tx8, [sp, #16] ; 8-byte Folded Reload\n\tldur\tx10, [x29, #-16]\n\tmov\tw9, #1\n\tstr\tw9, [x10]\n\tldur\tx0, [x29, #-8]\n\tldr\tw1, [x8]\n\tbl\t_UART_PUT_IER\n\tb\tLBB0_9\nLBB0_8: ; in Loop: Header=BB0_1 Depth=1\n\tldr\tx8, [sp, #16] ; 8-byte Folded Reload\n```", "role": "assistant" } ]
extr_atmel_serial.c_atmel_rx_chars.c
[ { "content": "You are given an x86 assembly block (<block>) to traspile into armv8_64 assembly.\nYou are also given the context for this block in the form of pre-context (<pre_context>) and post-context (<post_context>).\nThere is also a pre-target-context (<pre_target>) which is the context for the target block. Use the input pre and post context along with the target pre context to transpile the block from x86 to armv8_64.\n\n```x86asm\n; <pre-context>\n\tmovl\t$1, (%rax)\n\tmovq\t-8(%rbp), %rdi\n\tmovl\tATMEL_US_RXBRK(%rip), %esi\n\tcallq\tUART_PUT_IER@PLT\n\tjmp\t.LBB0_9\n.LBB0_8: # in Loop: Header=BB0_1 Depth=1\n\n; <block>\n\tmovq\t-8(%rbp), %rdi\n\tmovl\tATMEL_US_RXBRK(%rip), %esi\n\tcallq\tUART_PUT_IDR@PLT\n\tmovl\tATMEL_US_RXBRK(%rip), %eax\n\txorl\t$-1, %eax\n\tandl\t-20(%rbp), %eax\n\tmovl\t%eax, -20(%rbp)\n\tmovq\t-16(%rbp), %rax\n\tmovl\t$0, (%rax)\n.LBB0_9: # in Loop: Header=BB0_1 Depth=1\n\tjmp\t.LBB0_10\n.LBB0_10: # in Loop: Header=BB0_1 Depth=1\n\tmovq\t-8(%rbp), %rdi\n\tmovl\t-20(%rbp), %esi\n\n; <post-context>\n\tmovl\t-24(%rbp), %edx\n\tcallq\tatmel_buffer_rx_char@PLT\n\tmovq\t-8(%rbp), %rdi\n\tcallq\tUART_GET_CSR@PLT\n\tmovl\t%eax, -20(%rbp)\n\n```\n\n```armasm\n; <pre-target>\n\t.cfi_startproc\n; %bb.0:\n\tsub\tsp, sp, #64\n\t.cfi_def_cfa_offset 64\n\tstp\tx29, x30, [sp, #48] ; 16-byte Folded Spill\n\tadd\tx29, sp, #48\n\t.cfi_def_cfa w29, 16\n\t.cfi_offset w30, -8\n\t.cfi_offset w29, -16\n\tadrp\tx8, _ATMEL_US_RXBRK@GOTPAGE\n\tldr\tx8, [x8, _ATMEL_US_RXBRK@GOTPAGEOFF]\n\tstr\tx8, [sp, #16] ; 8-byte Folded Spill\n\tstur\tx0, [x29, #-8]\n\tldur\tx0, [x29, #-8]\n\tbl\t_to_atmel_uart_port\n\tstur\tx0, [x29, #-16]\n\tldur\tx0, [x29, #-8]\n\tbl\t_UART_GET_CSR\n\tstur\tw0, [x29, #-20]\n\tb\tLBB0_1\nLBB0_1: ; =>This Inner Loop Header: Depth=1\n\tldur\tw8, [x29, #-20]\n\tadrp\tx9, _ATMEL_US_RXRDY@GOTPAGE\n\tldr\tx9, [x9, _ATMEL_US_RXRDY@GOTPAGEOFF]\n\tldr\tw9, [x9]\n\tands\tw8, w8, w9\n\tcset\tw8, eq\n\ttbnz\tw8, #0, LBB0_11\n\tb\tLBB0_2\nLBB0_2: ; in Loop: Header=BB0_1 Depth=1\n\tldur\tx0, [x29, #-8]\n\tbl\t_UART_GET_CHAR\n\tldr\tx10, [sp, #16] ; 8-byte Folded Reload\n\tstr\tw0, [sp, #24]\n\tldur\tw8, [x29, #-20]\n\tadrp\tx9, _ATMEL_US_PARE@GOTPAGE\n\tldr\tx9, [x9, _ATMEL_US_PARE@GOTPAGEOFF]\n\tldr\tw9, [x9]\n\tadrp\tx11, _ATMEL_US_FRAME@GOTPAGE\n\tldr\tx11, [x11, _ATMEL_US_FRAME@GOTPAGEOFF]\n\tldr\tw11, [x11]\n\torr\tw9, w9, w11\n\tadrp\tx11, _ATMEL_US_OVRE@GOTPAGE\n\tldr\tx11, [x11, _ATMEL_US_OVRE@GOTPAGEOFF]\n\tldr\tw11, [x11]\n\torr\tw9, w9, w11\n\tldr\tw10, [x10]\n\torr\tw9, w9, w10\n\tands\tw8, w8, w9\n\tcset\tw8, ne\n\tmov\tw9, #1\n\tstr\tw9, [sp, #12] ; 4-byte Folded Spill\n\ttbnz\tw8, #0, LBB0_4\n\tb\tLBB0_3\nLBB0_3: ; in Loop: Header=BB0_1 Depth=1\n\tldur\tx8, [x29, #-16]\n\tldr\tw8, [x8]\n\tsubs\tw8, w8, #0\n\tcset\tw8, ne\n\tstr\tw8, [sp, #12] ; 4-byte Folded Spill\n\tb\tLBB0_4\nLBB0_4: ; in Loop: Header=BB0_1 Depth=1\n\tldr\tw8, [sp, #12] ; 4-byte Folded Reload\n\tand\tw0, w8, #0x1\n\tbl\t_unlikely\n\tsubs\tx8, x0, #0\n\tcset\tw8, eq\n\ttbnz\tw8, #0, LBB0_10\n\tb\tLBB0_5\nLBB0_5: ; in Loop: Header=BB0_1 Depth=1\n\tldur\tx0, [x29, #-8]\n\tadrp\tx8, _ATMEL_US_RSTSTA@GOTPAGE\n\tldr\tx8, [x8, _ATMEL_US_RSTSTA@GOTPAGEOFF]\n\tldr\tw1, [x8]\n\tbl\t_UART_PUT_CR\n\tldr\tx9, [sp, #16] ; 8-byte Folded Reload\n\tldur\tw8, [x29, #-20]\n\tldr\tw9, [x9]\n\tands\tw8, w8, w9\n\tcset\tw8, eq\n\ttbnz\tw8, #0, LBB0_8\n\tb\tLBB0_6\nLBB0_6: ; in Loop: Header=BB0_1 Depth=1\n\tldur\tx8, [x29, #-16]\n\tldr\tw8, [x8]\n\tsubs\tw8, w8, #0\n\tcset\tw8, ne\n\ttbnz\tw8, #0, LBB0_8\n\tb\tLBB0_7\nLBB0_7: ; in Loop: Header=BB0_1 Depth=1\n\tldr\tx8, [sp, #16] ; 8-byte Folded Reload\n\tldur\tx10, [x29, #-16]\n\tmov\tw9, #1\n\tstr\tw9, [x10]\n\tldur\tx0, [x29, #-8]\n\tldr\tw1, [x8]\n\tbl\t_UART_PUT_IER\n\tb\tLBB0_9\nLBB0_8: ; in Loop: Header=BB0_1 Depth=1\n\tldr\tx8, [sp, #16] ; 8-byte Folded Reload\n\n```", "role": "user" }, { "content": "```armasm\n\tldur\tx0, [x29, #-8]\n\tldr\tw1, [x8]\n\tbl\t_UART_PUT_IDR\n\tldr\tx8, [sp, #16] ; 8-byte Folded Reload\n\tldr\tw9, [x8]\n\tldur\tw8, [x29, #-20]\n\tbic\tw8, w8, w9\n\tstur\tw8, [x29, #-20]\n\tldur\tx8, [x29, #-16]\n\tstr\twzr, [x8]\n\tb\tLBB0_9\nLBB0_9: ; in Loop: Header=BB0_1 Depth=1\n\tb\tLBB0_10\nLBB0_10: ; in Loop: Header=BB0_1 Depth=1\n\tldur\tx0, [x29, #-8]\n\tldur\tw1, [x29, #-20]\n```", "role": "assistant" } ]
extr_atmel_serial.c_atmel_rx_chars.c
[ { "content": "You are given an x86 assembly block (<block>) to traspile into armv8_64 assembly.\nYou are also given the context for this block in the form of pre-context (<pre_context>) and post-context (<post_context>).\nThere is also a pre-target-context (<pre_target>) which is the context for the target block. Use the input pre and post context along with the target pre context to transpile the block from x86 to armv8_64.\n\n```x86asm\n; <pre-context>\n\tmovq\t-16(%rbp), %rax\n\tmovl\t$0, (%rax)\n.LBB0_9: # in Loop: Header=BB0_1 Depth=1\n\tjmp\t.LBB0_10\n.LBB0_10: # in Loop: Header=BB0_1 Depth=1\n\tmovq\t-8(%rbp), %rdi\n\tmovl\t-20(%rbp), %esi\n\n; <block>\n\tmovl\t-24(%rbp), %edx\n\tcallq\tatmel_buffer_rx_char@PLT\n\tmovq\t-8(%rbp), %rdi\n\tcallq\tUART_GET_CSR@PLT\n\tmovl\t%eax, -20(%rbp)\n\tjmp\t.LBB0_1\n.LBB0_11:\n\tmovq\t-16(%rbp), %rdi\n\taddq\t$4, %rdi\n\tcallq\ttasklet_schedule@PLT\n\taddq\t$32, %rsp\n\tpopq\t%rbp\n\t.cfi_def_cfa %rsp, 8\n\tretq\n.Lfunc_end0:\n\t.size\tatmel_rx_chars, .Lfunc_end0-atmel_rx_chars\n\t.cfi_endproc\n # -- End function\n\t.type\tATMEL_US_RXRDY,@object # @ATMEL_US_RXRDY\n\t.bss\n\t.globl\tATMEL_US_RXRDY\n\t.p2align\t2, 0x0\nATMEL_US_RXRDY:\n\t.long\t0 # 0x0\n\t.size\tATMEL_US_RXRDY, 4\n\n\t.type\tATMEL_US_PARE,@object # @ATMEL_US_PARE\n\t.globl\tATMEL_US_PARE\n\t.p2align\t2, 0x0\nATMEL_US_PARE:\n\t.long\t0 # 0x0\n\t.size\tATMEL_US_PARE, 4\n\n\t.type\tATMEL_US_FRAME,@object # @ATMEL_US_FRAME\n\t.globl\tATMEL_US_FRAME\n\t.p2align\t2, 0x0\nATMEL_US_FRAME:\n\t.long\t0 # 0x0\n\t.size\tATMEL_US_FRAME, 4\n\n\t.type\tATMEL_US_OVRE,@object # @ATMEL_US_OVRE\n\t.globl\tATMEL_US_OVRE\n\t.p2align\t2, 0x0\nATMEL_US_OVRE:\n\t.long\t0 # 0x0\n\t.size\tATMEL_US_OVRE, 4\n\n\t.type\tATMEL_US_RXBRK,@object # @ATMEL_US_RXBRK\n\t.globl\tATMEL_US_RXBRK\n\t.p2align\t2, 0x0\nATMEL_US_RXBRK:\n\t.long\t0 # 0x0\n\t.size\tATMEL_US_RXBRK, 4\n\n\t.type\tATMEL_US_RSTSTA,@object # @ATMEL_US_RSTSTA\n\t.globl\tATMEL_US_RSTSTA\n\t.p2align\t2, 0x0\nATMEL_US_RSTSTA:\n\t.long\t0 # 0x0\n\t.size\tATMEL_US_RSTSTA, 4\n\n\t.ident\t\"Ubuntu clang version 18.1.3 (1ubuntu1)\"\n\t.section\t\".note.GNU-stack\",\"\",@progbits\n\t.addrsig\n\t.addrsig_sym atmel_rx_chars\n\t.addrsig_sym to_atmel_uart_port\n\t.addrsig_sym UART_GET_CSR\n\t.addrsig_sym UART_GET_CHAR\n\t.addrsig_sym unlikely\n\t.addrsig_sym UART_PUT_CR\n\t.addrsig_sym UART_PUT_IER\n\t.addrsig_sym UART_PUT_IDR\n\t.addrsig_sym atmel_buffer_rx_char\n\t.addrsig_sym tasklet_schedule\n\t.addrsig_sym ATMEL_US_RXRDY\n\t.addrsig_sym ATMEL_US_PARE\n\t.addrsig_sym ATMEL_US_FRAME\n\t.addrsig_sym ATMEL_US_OVRE\n\t.addrsig_sym ATMEL_US_RXBRK\n\t.addrsig_sym ATMEL_US_RSTSTA\n\n; <post-context>\n\n```\n\n```armasm\n; <pre-target>\n\t.cfi_startproc\n; %bb.0:\n\tsub\tsp, sp, #64\n\t.cfi_def_cfa_offset 64\n\tstp\tx29, x30, [sp, #48] ; 16-byte Folded Spill\n\tadd\tx29, sp, #48\n\t.cfi_def_cfa w29, 16\n\t.cfi_offset w30, -8\n\t.cfi_offset w29, -16\n\tadrp\tx8, _ATMEL_US_RXBRK@GOTPAGE\n\tldr\tx8, [x8, _ATMEL_US_RXBRK@GOTPAGEOFF]\n\tstr\tx8, [sp, #16] ; 8-byte Folded Spill\n\tstur\tx0, [x29, #-8]\n\tldur\tx0, [x29, #-8]\n\tbl\t_to_atmel_uart_port\n\tstur\tx0, [x29, #-16]\n\tldur\tx0, [x29, #-8]\n\tbl\t_UART_GET_CSR\n\tstur\tw0, [x29, #-20]\n\tb\tLBB0_1\nLBB0_1: ; =>This Inner Loop Header: Depth=1\n\tldur\tw8, [x29, #-20]\n\tadrp\tx9, _ATMEL_US_RXRDY@GOTPAGE\n\tldr\tx9, [x9, _ATMEL_US_RXRDY@GOTPAGEOFF]\n\tldr\tw9, [x9]\n\tands\tw8, w8, w9\n\tcset\tw8, eq\n\ttbnz\tw8, #0, LBB0_11\n\tb\tLBB0_2\nLBB0_2: ; in Loop: Header=BB0_1 Depth=1\n\tldur\tx0, [x29, #-8]\n\tbl\t_UART_GET_CHAR\n\tldr\tx10, [sp, #16] ; 8-byte Folded Reload\n\tstr\tw0, [sp, #24]\n\tldur\tw8, [x29, #-20]\n\tadrp\tx9, _ATMEL_US_PARE@GOTPAGE\n\tldr\tx9, [x9, _ATMEL_US_PARE@GOTPAGEOFF]\n\tldr\tw9, [x9]\n\tadrp\tx11, _ATMEL_US_FRAME@GOTPAGE\n\tldr\tx11, [x11, _ATMEL_US_FRAME@GOTPAGEOFF]\n\tldr\tw11, [x11]\n\torr\tw9, w9, w11\n\tadrp\tx11, _ATMEL_US_OVRE@GOTPAGE\n\tldr\tx11, [x11, _ATMEL_US_OVRE@GOTPAGEOFF]\n\tldr\tw11, [x11]\n\torr\tw9, w9, w11\n\tldr\tw10, [x10]\n\torr\tw9, w9, w10\n\tands\tw8, w8, w9\n\tcset\tw8, ne\n\tmov\tw9, #1\n\tstr\tw9, [sp, #12] ; 4-byte Folded Spill\n\ttbnz\tw8, #0, LBB0_4\n\tb\tLBB0_3\nLBB0_3: ; in Loop: Header=BB0_1 Depth=1\n\tldur\tx8, [x29, #-16]\n\tldr\tw8, [x8]\n\tsubs\tw8, w8, #0\n\tcset\tw8, ne\n\tstr\tw8, [sp, #12] ; 4-byte Folded Spill\n\tb\tLBB0_4\nLBB0_4: ; in Loop: Header=BB0_1 Depth=1\n\tldr\tw8, [sp, #12] ; 4-byte Folded Reload\n\tand\tw0, w8, #0x1\n\tbl\t_unlikely\n\tsubs\tx8, x0, #0\n\tcset\tw8, eq\n\ttbnz\tw8, #0, LBB0_10\n\tb\tLBB0_5\nLBB0_5: ; in Loop: Header=BB0_1 Depth=1\n\tldur\tx0, [x29, #-8]\n\tadrp\tx8, _ATMEL_US_RSTSTA@GOTPAGE\n\tldr\tx8, [x8, _ATMEL_US_RSTSTA@GOTPAGEOFF]\n\tldr\tw1, [x8]\n\tbl\t_UART_PUT_CR\n\tldr\tx9, [sp, #16] ; 8-byte Folded Reload\n\tldur\tw8, [x29, #-20]\n\tldr\tw9, [x9]\n\tands\tw8, w8, w9\n\tcset\tw8, eq\n\ttbnz\tw8, #0, LBB0_8\n\tb\tLBB0_6\nLBB0_6: ; in Loop: Header=BB0_1 Depth=1\n\tldur\tx8, [x29, #-16]\n\tldr\tw8, [x8]\n\tsubs\tw8, w8, #0\n\tcset\tw8, ne\n\ttbnz\tw8, #0, LBB0_8\n\tb\tLBB0_7\nLBB0_7: ; in Loop: Header=BB0_1 Depth=1\n\tldr\tx8, [sp, #16] ; 8-byte Folded Reload\n\tldur\tx10, [x29, #-16]\n\tmov\tw9, #1\n\tstr\tw9, [x10]\n\tldur\tx0, [x29, #-8]\n\tldr\tw1, [x8]\n\tbl\t_UART_PUT_IER\n\tb\tLBB0_9\nLBB0_8: ; in Loop: Header=BB0_1 Depth=1\n\tldr\tx8, [sp, #16] ; 8-byte Folded Reload\n\tldur\tx0, [x29, #-8]\n\tldr\tw1, [x8]\n\tbl\t_UART_PUT_IDR\n\tldr\tx8, [sp, #16] ; 8-byte Folded Reload\n\tldr\tw9, [x8]\n\tldur\tw8, [x29, #-20]\n\tbic\tw8, w8, w9\n\tstur\tw8, [x29, #-20]\n\tldur\tx8, [x29, #-16]\n\tstr\twzr, [x8]\n\tb\tLBB0_9\nLBB0_9: ; in Loop: Header=BB0_1 Depth=1\n\tb\tLBB0_10\nLBB0_10: ; in Loop: Header=BB0_1 Depth=1\n\tldur\tx0, [x29, #-8]\n\tldur\tw1, [x29, #-20]\n\n```", "role": "user" }, { "content": "```armasm\n\tldr\tw2, [sp, #24]\n\tbl\t_atmel_buffer_rx_char\n\tldur\tx0, [x29, #-8]\n\tbl\t_UART_GET_CSR\n\tstur\tw0, [x29, #-20]\n\tb\tLBB0_1\nLBB0_11:\n\tldur\tx8, [x29, #-16]\n\tadd\tx0, x8, #4\n\tbl\t_tasklet_schedule\n\tldp\tx29, x30, [sp, #48] ; 16-byte Folded Reload\n\tadd\tsp, sp, #64\n\tret\n\t.cfi_endproc\n ; -- End function\n\t.comm\t_ATMEL_US_RXRDY,4,2 ; @ATMEL_US_RXRDY\n\t.comm\t_ATMEL_US_PARE,4,2 ; @ATMEL_US_PARE\n\t.comm\t_ATMEL_US_FRAME,4,2 ; @ATMEL_US_FRAME\n\t.comm\t_ATMEL_US_OVRE,4,2 ; @ATMEL_US_OVRE\n\t.comm\t_ATMEL_US_RXBRK,4,2 ; @ATMEL_US_RXBRK\n\t.comm\t_ATMEL_US_RSTSTA,4,2 ; @ATMEL_US_RSTSTA\n\t.no_dead_strip\t_atmel_rx_chars\n.subsections_via_symbols\n```", "role": "assistant" } ]
extr_ecore_vf.c_ecore_vf_get_link_caps.c
[ { "content": "You are given an x86 assembly block (<block>) to traspile into armv8_64 assembly.\nYou are also given the context for this block in the form of pre-context (<pre_context>) and post-context (<post_context>).\nThere is also a pre-target-context (<pre_target>) which is the context for the target block. Use the input pre and post context along with the target pre context to transpile the block from x86 to armv8_64.\n\n```x86asm\n; <pre-context>\n\n; <block>\n\t.text\n\t.file\t\"extr_ecore_vf.c_ecore_vf_get_link_caps.c\"\n\t.globl\tecore_vf_get_link_caps # -- Begin function ecore_vf_get_link_caps\n\t.p2align\t4, 0x90\n\t.type\tecore_vf_get_link_caps,@function\necore_vf_get_link_caps: # @ecore_vf_get_link_caps\n\t.cfi_startproc\n# %bb.0:\n\tpushq\t%rbp\n\t.cfi_def_cfa_offset 16\n\t.cfi_offset %rbp, -16\n\tmovq\t%rsp, %rbp\n\t.cfi_def_cfa_register %rbp\n\tsubq\t$16, %rsp\n\tmovq\t%rdi, -8(%rbp)\n\tmovq\t%rsi, -16(%rbp)\n\tmovq\t-16(%rbp), %rdi\n\tmovq\t-8(%rbp), %rax\n\tmovq\t(%rax), %rsi\n\tcallq\t__ecore_vf_get_link_caps@PLT\n\taddq\t$16, %rsp\n\tpopq\t%rbp\n\t.cfi_def_cfa %rsp, 8\n\tretq\n.Lfunc_end0:\n\t.size\tecore_vf_get_link_caps, .Lfunc_end0-ecore_vf_get_link_caps\n\t.cfi_endproc\n # -- End function\n\t.ident\t\"Ubuntu clang version 18.1.3 (1ubuntu1)\"\n\t.section\t\".note.GNU-stack\",\"\",@progbits\n\t.addrsig\n\t.addrsig_sym __ecore_vf_get_link_caps\n\n; <post-context>\n\n```\n\n```armasm\n; <pre-target>\n\n```", "role": "user" }, { "content": "```armasm\n\t.section\t__TEXT,__text,regular,pure_instructions\n\t.build_version macos, 13, 0\tsdk_version 13, 3\n\t.globl\t_ecore_vf_get_link_caps ; -- Begin function ecore_vf_get_link_caps\n\t.p2align\t2\n_ecore_vf_get_link_caps: ; @ecore_vf_get_link_caps\n\t.cfi_startproc\n; %bb.0:\n\tsub\tsp, sp, #32\n\t.cfi_def_cfa_offset 32\n\tstp\tx29, x30, [sp, #16] ; 16-byte Folded Spill\n\tadd\tx29, sp, #16\n\t.cfi_def_cfa w29, 16\n\t.cfi_offset w30, -8\n\t.cfi_offset w29, -16\n\tstr\tx0, [sp, #8]\n\tstr\tx1, [sp]\n\tldr\tx0, [sp]\n\tldr\tx8, [sp, #8]\n\tldr\tx1, [x8]\n\tbl\t___ecore_vf_get_link_caps\n\tldp\tx29, x30, [sp, #16] ; 16-byte Folded Reload\n\tadd\tsp, sp, #32\n\tret\n\t.cfi_endproc\n ; -- End function\n.subsections_via_symbols\n```", "role": "assistant" } ]
extr_sdhci-esdhc-imx.c_is_imx25_esdhc.c
[ { "content": "You are given an x86 assembly block (<block>) to traspile into armv8_64 assembly.\nYou are also given the context for this block in the form of pre-context (<pre_context>) and post-context (<post_context>).\nThere is also a pre-target-context (<pre_target>) which is the context for the target block. Use the input pre and post context along with the target pre context to transpile the block from x86 to armv8_64.\n\n```x86asm\n; <pre-context>\n\n; <block>\n\t.text\n\t.file\t\"extr_sdhci-esdhc-imx.c_is_imx25_esdhc.c\"\n\t.p2align\t4, 0x90 # -- Begin function is_imx25_esdhc\n\t.type\tis_imx25_esdhc,@function\nis_imx25_esdhc: # @is_imx25_esdhc\n\t.cfi_startproc\n# %bb.0:\n\tpushq\t%rbp\n\t.cfi_def_cfa_offset 16\n\t.cfi_offset %rbp, -16\n\tmovq\t%rsp, %rbp\n\t.cfi_def_cfa_register %rbp\n\tmovq\t%rdi, -8(%rbp)\n\tmovq\t-8(%rbp), %rax\n\tleaq\tesdhc_imx25_data(%rip), %rcx\n\tcmpq\t%rcx, (%rax)\n\tsete\t%al\n\tandb\t$1, %al\n\tmovzbl\t%al, %eax\n\tpopq\t%rbp\n\t.cfi_def_cfa %rsp, 8\n\tretq\n.Lfunc_end0:\n\t.size\tis_imx25_esdhc, .Lfunc_end0-is_imx25_esdhc\n\t.cfi_endproc\n # -- End function\n\t.type\tesdhc_imx25_data,@object # @esdhc_imx25_data\n\t.bss\n\t.globl\tesdhc_imx25_data\n\t.p2align\t2, 0x0\nesdhc_imx25_data:\n\t.long\t0 # 0x0\n\t.size\tesdhc_imx25_data, 4\n\n\t.ident\t\"Ubuntu clang version 18.1.3 (1ubuntu1)\"\n\t.section\t\".note.GNU-stack\",\"\",@progbits\n\t.addrsig\n\t.addrsig_sym is_imx25_esdhc\n\t.addrsig_sym esdhc_imx25_data\n\n; <post-context>\n\n```\n\n```armasm\n; <pre-target>\n\n```", "role": "user" }, { "content": "```armasm\n\t.section\t__TEXT,__text,regular,pure_instructions\n\t.build_version macos, 13, 0\tsdk_version 13, 3\n\t.p2align\t2 ; -- Begin function is_imx25_esdhc\n_is_imx25_esdhc: ; @is_imx25_esdhc\n\t.cfi_startproc\n; %bb.0:\n\tsub\tsp, sp, #16\n\t.cfi_def_cfa_offset 16\n\tstr\tx0, [sp, #8]\n\tldr\tx8, [sp, #8]\n\tldr\tx8, [x8]\n\tadrp\tx9, _esdhc_imx25_data@GOTPAGE\n\tldr\tx9, [x9, _esdhc_imx25_data@GOTPAGEOFF]\n\tsubs\tx8, x8, x9\n\tcset\tw8, eq\n\tand\tw0, w8, #0x1\n\tadd\tsp, sp, #16\n\tret\n\t.cfi_endproc\n ; -- End function\n\t.comm\t_esdhc_imx25_data,4,2 ; @esdhc_imx25_data\n\t.no_dead_strip\t_is_imx25_esdhc\n.subsections_via_symbols\n```", "role": "assistant" } ]
extr_memalloc.c_ckfree.c
[ { "content": "You are given an x86 assembly block (<block>) to traspile into armv8_64 assembly.\nYou are also given the context for this block in the form of pre-context (<pre_context>) and post-context (<post_context>).\nThere is also a pre-target-context (<pre_target>) which is the context for the target block. Use the input pre and post context along with the target pre context to transpile the block from x86 to armv8_64.\n\n```x86asm\n; <pre-context>\n\n; <block>\n\t.text\n\t.file\t\"extr_memalloc.c_ckfree.c\"\n\t.globl\tckfree # -- Begin function ckfree\n\t.p2align\t4, 0x90\n\t.type\tckfree,@function\nckfree: # @ckfree\n\t.cfi_startproc\n# %bb.0:\n\tpushq\t%rbp\n\t.cfi_def_cfa_offset 16\n\t.cfi_offset %rbp, -16\n\tmovq\t%rsp, %rbp\n\t.cfi_def_cfa_register %rbp\n\tsubq\t$16, %rsp\n\tmovl\t%edi, -4(%rbp)\n\tmovl\t-4(%rbp), %edi\n\tcallq\tfree@PLT\n\taddq\t$16, %rsp\n\tpopq\t%rbp\n\t.cfi_def_cfa %rsp, 8\n\tretq\n.Lfunc_end0:\n\t.size\tckfree, .Lfunc_end0-ckfree\n\t.cfi_endproc\n # -- End function\n\t.type\tINTOFF,@object # @INTOFF\n\t.bss\n\t.globl\tINTOFF\n\t.p2align\t2, 0x0\nINTOFF:\n\t.long\t0 # 0x0\n\t.size\tINTOFF, 4\n\n\t.type\tINTON,@object # @INTON\n\t.globl\tINTON\n\t.p2align\t2, 0x0\nINTON:\n\t.long\t0 # 0x0\n\t.size\tINTON, 4\n\n\t.ident\t\"Ubuntu clang version 18.1.3 (1ubuntu1)\"\n\t.section\t\".note.GNU-stack\",\"\",@progbits\n\t.addrsig\n\t.addrsig_sym free\n\t.addrsig_sym INTOFF\n\t.addrsig_sym INTON\n\n; <post-context>\n\n```\n\n```armasm\n; <pre-target>\n\n```", "role": "user" }, { "content": "```armasm\n\t.section\t__TEXT,__text,regular,pure_instructions\n\t.build_version macos, 13, 0\tsdk_version 13, 3\n\t.globl\t_ckfree ; -- Begin function ckfree\n\t.p2align\t2\n_ckfree: ; @ckfree\n\t.cfi_startproc\n; %bb.0:\n\tsub\tsp, sp, #32\n\t.cfi_def_cfa_offset 32\n\tstp\tx29, x30, [sp, #16] ; 16-byte Folded Spill\n\tadd\tx29, sp, #16\n\t.cfi_def_cfa w29, 16\n\t.cfi_offset w30, -8\n\t.cfi_offset w29, -16\n\tstur\tw0, [x29, #-4]\n\tldur\tw0, [x29, #-4]\n\tbl\t_free\n\tldp\tx29, x30, [sp, #16] ; 16-byte Folded Reload\n\tadd\tsp, sp, #32\n\tret\n\t.cfi_endproc\n ; -- End function\n\t.comm\t_INTOFF,4,2 ; @INTOFF\n\t.comm\t_INTON,4,2 ; @INTON\n.subsections_via_symbols\n```", "role": "assistant" } ]
extr_aw_nmi.c_aw_nmi_teardown_intr.c
[ { "content": "You are given an x86 assembly block (<block>) to traspile into armv8_64 assembly.\nYou are also given the context for this block in the form of pre-context (<pre_context>) and post-context (<post_context>).\nThere is also a pre-target-context (<pre_target>) which is the context for the target block. Use the input pre and post context along with the target pre context to transpile the block from x86 to armv8_64.\n\n```x86asm\n; <pre-context>\n\n; <block>\n\t.text\n\t.file\t\"extr_aw_nmi.c_aw_nmi_teardown_intr.c\"\n\t.p2align\t4, 0x90 # -- Begin function aw_nmi_teardown_intr\n\t.type\taw_nmi_teardown_intr,@function\naw_nmi_teardown_intr: # @aw_nmi_teardown_intr\n\t.cfi_startproc\n# %bb.0:\n\tpushq\t%rbp\n\t.cfi_def_cfa_offset 16\n\t.cfi_offset %rbp, -16\n\tmovq\t%rsp, %rbp\n\t.cfi_def_cfa_register %rbp\n\tsubq\t$48, %rsp\n\tmovl\t%edi, -4(%rbp)\n\tmovq\t%rsi, -16(%rbp)\n\tmovq\t%rdx, -24(%rbp)\n\tmovq\t%rcx, -32(%rbp)\n\tmovl\t-4(%rbp), %edi\n\tcallq\tdevice_get_softc@PLT\n\tmovq\t%rax, -40(%rbp)\n\tmovq\t-16(%rbp), %rax\n\tcmpq\t$0, (%rax)\n\tjne\t.LBB0_2\n# %bb.1:\n\tmovl\tINTR_POLARITY_CONFORM(%rip), %ecx\n\tmovq\t-40(%rbp), %rax\n\n; <post-context>\n\tmovl\t%ecx, 12(%rax)\n\tmovl\tINTR_TRIGGER_CONFORM(%rip), %ecx\n\tmovq\t-40(%rbp), %rax\n\tmovl\t%ecx, 8(%rax)\n\tmovq\t-40(%rbp), %rdi\n\n```\n\n```armasm\n; <pre-target>\n\n```", "role": "user" }, { "content": "```armasm\n\t.section\t__TEXT,__text,regular,pure_instructions\n\t.build_version macos, 13, 0\tsdk_version 13, 3\n\t.p2align\t2 ; -- Begin function aw_nmi_teardown_intr\n_aw_nmi_teardown_intr: ; @aw_nmi_teardown_intr\n\t.cfi_startproc\n; %bb.0:\n\tsub\tsp, sp, #64\n\t.cfi_def_cfa_offset 64\n\tstp\tx29, x30, [sp, #48] ; 16-byte Folded Spill\n\tadd\tx29, sp, #48\n\t.cfi_def_cfa w29, 16\n\t.cfi_offset w30, -8\n\t.cfi_offset w29, -16\n\tstur\tw0, [x29, #-4]\n\tstur\tx1, [x29, #-16]\n\tstr\tx2, [sp, #24]\n\tstr\tx3, [sp, #16]\n\tldur\tw0, [x29, #-4]\n\tbl\t_device_get_softc\n\tstr\tx0, [sp, #8]\n\tldur\tx8, [x29, #-16]\n\tldr\tx8, [x8]\n\tsubs\tx8, x8, #0\n\tcset\tw8, ne\n\ttbnz\tw8, #0, LBB0_2\n\tb\tLBB0_1\nLBB0_1:\n\tadrp\tx8, _INTR_POLARITY_CONFORM@GOTPAGE\n\tldr\tx8, [x8, _INTR_POLARITY_CONFORM@GOTPAGEOFF]\n\tldr\tw8, [x8]\n\tldr\tx9, [sp, #8]\n```", "role": "assistant" } ]
extr_aw_nmi.c_aw_nmi_teardown_intr.c
[ { "content": "You are given an x86 assembly block (<block>) to traspile into armv8_64 assembly.\nYou are also given the context for this block in the form of pre-context (<pre_context>) and post-context (<post_context>).\nThere is also a pre-target-context (<pre_target>) which is the context for the target block. Use the input pre and post context along with the target pre context to transpile the block from x86 to armv8_64.\n\n```x86asm\n; <pre-context>\n\tmovq\t-16(%rbp), %rax\n\tcmpq\t$0, (%rax)\n\tjne\t.LBB0_2\n# %bb.1:\n\tmovl\tINTR_POLARITY_CONFORM(%rip), %ecx\n\tmovq\t-40(%rbp), %rax\n\n; <block>\n\tmovl\t%ecx, 12(%rax)\n\tmovl\tINTR_TRIGGER_CONFORM(%rip), %ecx\n\tmovq\t-40(%rbp), %rax\n\tmovl\t%ecx, 8(%rax)\n\tmovq\t-40(%rbp), %rdi\n\tmovq\t-40(%rbp), %rax\n\tmovq\t(%rax), %rax\n\tmovl\t(%rax), %esi\n\tcmpl\t$0, NMI_IRQ_ENABLE(%rip)\n\tsetne\t%al\n\txorb\t$-1, %al\n\tandb\t$1, %al\n\tmovzbl\t%al, %edx\n\tcallq\tSC_NMI_WRITE@PLT\n.LBB0_2:\n\txorl\t%eax, %eax\n\n; <post-context>\n\taddq\t$48, %rsp\n\tpopq\t%rbp\n\t.cfi_def_cfa %rsp, 8\n\tretq\n.Lfunc_end0:\n\t.size\taw_nmi_teardown_intr, .Lfunc_end0-aw_nmi_teardown_intr\n\t.cfi_endproc\n # -- End function\n\t.type\tINTR_POLARITY_CONFORM,@object # @INTR_POLARITY_CONFORM\n\t.bss\n\t.globl\tINTR_POLARITY_CONFORM\n\t.p2align\t2, 0x0\nINTR_POLARITY_CONFORM:\n\t.long\t0 # 0x0\n\t.size\tINTR_POLARITY_CONFORM, 4\n\n\t.type\tINTR_TRIGGER_CONFORM,@object # @INTR_TRIGGER_CONFORM\n\t.globl\tINTR_TRIGGER_CONFORM\n\t.p2align\t2, 0x0\nINTR_TRIGGER_CONFORM:\n\t.long\t0 # 0x0\n\t.size\tINTR_TRIGGER_CONFORM, 4\n\n\t.type\tNMI_IRQ_ENABLE,@object # @NMI_IRQ_ENABLE\n\t.globl\tNMI_IRQ_ENABLE\n\t.p2align\t2, 0x0\nNMI_IRQ_ENABLE:\n\t.long\t0 # 0x0\n\t.size\tNMI_IRQ_ENABLE, 4\n\n\t.ident\t\"Ubuntu clang version 18.1.3 (1ubuntu1)\"\n\t.section\t\".note.GNU-stack\",\"\",@progbits\n\t.addrsig\n\t.addrsig_sym aw_nmi_teardown_intr\n\t.addrsig_sym device_get_softc\n\t.addrsig_sym SC_NMI_WRITE\n\t.addrsig_sym INTR_POLARITY_CONFORM\n\t.addrsig_sym INTR_TRIGGER_CONFORM\n\t.addrsig_sym NMI_IRQ_ENABLE\n\n```\n\n```armasm\n; <pre-target>\n\t.cfi_startproc\n; %bb.0:\n\tsub\tsp, sp, #64\n\t.cfi_def_cfa_offset 64\n\tstp\tx29, x30, [sp, #48] ; 16-byte Folded Spill\n\tadd\tx29, sp, #48\n\t.cfi_def_cfa w29, 16\n\t.cfi_offset w30, -8\n\t.cfi_offset w29, -16\n\tstur\tw0, [x29, #-4]\n\tstur\tx1, [x29, #-16]\n\tstr\tx2, [sp, #24]\n\tstr\tx3, [sp, #16]\n\tldur\tw0, [x29, #-4]\n\tbl\t_device_get_softc\n\tstr\tx0, [sp, #8]\n\tldur\tx8, [x29, #-16]\n\tldr\tx8, [x8]\n\tsubs\tx8, x8, #0\n\tcset\tw8, ne\n\ttbnz\tw8, #0, LBB0_2\n\tb\tLBB0_1\nLBB0_1:\n\tadrp\tx8, _INTR_POLARITY_CONFORM@GOTPAGE\n\tldr\tx8, [x8, _INTR_POLARITY_CONFORM@GOTPAGEOFF]\n\tldr\tw8, [x8]\n\tldr\tx9, [sp, #8]\n\n```", "role": "user" }, { "content": "```armasm\n\tstr\tw8, [x9, #12]\n\tadrp\tx8, _INTR_TRIGGER_CONFORM@GOTPAGE\n\tldr\tx8, [x8, _INTR_TRIGGER_CONFORM@GOTPAGEOFF]\n\tldr\tw8, [x8]\n\tldr\tx9, [sp, #8]\n\tstr\tw8, [x9, #8]\n\tldr\tx0, [sp, #8]\n\tldr\tx8, [sp, #8]\n\tldr\tx8, [x8]\n\tldr\tw1, [x8]\n\tadrp\tx8, _NMI_IRQ_ENABLE@GOTPAGE\n\tldr\tx8, [x8, _NMI_IRQ_ENABLE@GOTPAGEOFF]\n\tldr\tw8, [x8]\n\tsubs\tw8, w8, #0\n\tcset\tw8, eq\n\tand\tw2, w8, #0x1\n\tbl\t_SC_NMI_WRITE\n\tb\tLBB0_2\nLBB0_2:\n\tmov\tw0, #0\n```", "role": "assistant" } ]