+/* helper function for emit_ia32_Minus64Bit */
+static void emit_neg(const ir_node* node, const arch_register_t *reg)
+{
+ be_emit_cstring("\tnegl ");
+ emit_register(reg, NULL);
+ be_emit_finish_line_gas(node);
+}
+
+/* helper function for emit_ia32_Minus64Bit */
+static void emit_sbb0(const ir_node* node, const arch_register_t *reg)
+{
+ be_emit_cstring("\tsbbl $0, ");
+ emit_register(reg, NULL);
+ be_emit_finish_line_gas(node);
+}
+
+/* helper function for emit_ia32_Minus64Bit */
+static void emit_sbb(const ir_node* node, const arch_register_t *src, const arch_register_t *dst)
+{
+ be_emit_cstring("\tsbbl ");
+ emit_register(src, NULL);
+ be_emit_cstring(", ");
+ emit_register(dst, NULL);
+ be_emit_finish_line_gas(node);
+}
+
+/* helper function for emit_ia32_Minus64Bit */
+static void emit_xchg(const ir_node* node, const arch_register_t *src, const arch_register_t *dst)
+{
+ be_emit_cstring("\txchgl ");
+ emit_register(src, NULL);
+ be_emit_cstring(", ");
+ emit_register(dst, NULL);
+ be_emit_finish_line_gas(node);
+}
+
+/* helper function for emit_ia32_Minus64Bit */
+static void emit_zero(const ir_node* node, const arch_register_t *reg)
+{
+ be_emit_cstring("\txorl ");
+ emit_register(reg, NULL);
+ be_emit_cstring(", ");
+ emit_register(reg, NULL);
+ be_emit_finish_line_gas(node);
+}
+
+static void emit_ia32_Minus64Bit(const ir_node *node)
+{
+ const arch_register_t *in_lo = get_in_reg(node, 0);
+ const arch_register_t *in_hi = get_in_reg(node, 1);
+ const arch_register_t *out_lo = get_out_reg(node, 0);
+ const arch_register_t *out_hi = get_out_reg(node, 1);
+
+ if (out_lo == in_lo) {
+ if (out_hi != in_hi) {
+ /* a -> a, b -> d */
+ goto zero_neg;
+ } else {
+ /* a -> a, b -> b */
+ goto normal_neg;
+ }
+ } else if (out_lo == in_hi) {
+ if (out_hi == in_lo) {
+ /* a -> b, b -> a */
+ emit_xchg(node, in_lo, in_hi);
+ goto normal_neg;
+ } else {
+ /* a -> b, b -> d */
+ emit_mov(node, in_hi, out_hi);
+ emit_mov(node, in_lo, out_lo);
+ goto normal_neg;
+ }
+ } else {
+ if (out_hi == in_lo) {
+ /* a -> c, b -> a */
+ emit_mov(node, in_lo, out_lo);
+ goto zero_neg;
+ } else if (out_hi == in_hi) {
+ /* a -> c, b -> b */
+ emit_mov(node, in_lo, out_lo);
+ goto normal_neg;
+ } else {
+ /* a -> c, b -> d */
+ emit_mov(node, in_lo, out_lo);
+ goto zero_neg;
+ }
+ }
+
+normal_neg:
+ emit_neg( node, out_hi);
+ emit_neg( node, out_lo);
+ emit_sbb0(node, out_hi);
+ return;
+
+zero_neg:
+ emit_zero(node, out_hi);
+ emit_neg( node, out_lo);
+ emit_sbb( node, in_hi, out_hi);
+}
+
+static void emit_be_Return(const ir_node *node)
+{
+ unsigned pop;
+ be_emit_cstring("\tret");
+
+ pop = be_Return_get_pop(node);
+ if(pop > 0) {
+ be_emit_irprintf(" $%d", pop);
+ }
+ be_emit_finish_line_gas(node);
+}
+
+static void emit_Nothing(const ir_node *node)