+static void print_asm_constraints(asm_constraint_t *constraints)
+{
+ asm_constraint_t *constraint = constraints;
+ for( ; constraint != NULL; constraint = constraint->next) {
+ if(constraint != constraints)
+ fputs(", ", out);
+
+ if(constraint->symbol) {
+ fprintf(out, "[%s] ", constraint->symbol->string);
+ }
+ print_quoted_string(constraint->constraints);
+ fputs(" (", out);
+ print_expression(constraint->expression);
+ fputs(")", out);
+ }
+}
+
+static void print_asm_clobbers(asm_clobber_t *clobbers)
+{
+ asm_clobber_t *clobber = clobbers;
+ for( ; clobber != NULL; clobber = clobber->next) {
+ if(clobber != clobbers)
+ fputs(", ", out);
+
+ print_quoted_string(clobber->clobber);
+ }
+}
+
+static void print_asm_statement(const asm_statement_t *statement)
+{
+ fputs("asm ", out);
+ if(statement->is_volatile) {
+ fputs("volatile ", out);
+ }
+ fputs("(", out);
+ print_quoted_string(statement->asm_text);
+ if(statement->inputs == NULL && statement->outputs == NULL
+ && statement->clobbers == NULL)
+ goto end_of_print_asm_statement;
+
+ fputs(" : ", out);
+ print_asm_constraints(statement->inputs);
+ if(statement->outputs == NULL && statement->clobbers == NULL)
+ goto end_of_print_asm_statement;
+
+ fputs(" : ", out);
+ print_asm_constraints(statement->outputs);
+ if(statement->clobbers == NULL)
+ goto end_of_print_asm_statement;
+
+ fputs(" : ", out);
+ print_asm_clobbers(statement->clobbers);
+
+end_of_print_asm_statement:
+ fputs(");\n", out);
+}
+