// File: /workspace/github_c_makefile_star2_O3/ryvnf[P]czc/codegen.c
// Function: clause_to_c
struct rope *clause_to_c(struct ast *ast)
{
    struct rope *rope = NULL;
    struct ast *stmt_list;

    switch (ast->tag) {
        case CASE_CLAUSE: {
            size_t n_asts;
            struct ast **asts = ast_asts(ast_ast(ast, 0), &n_asts);

            for (size_t i = 0; i < n_asts; i++) {
                rope = rope_new_tree(rope, add_indent(case_sp_rope));
                
                size_t n = eval_size(asts[i]);

                rope = rope_new_tree(rope, rope_new_fmt("%d", n));
                rope = rope_new_tree(rope, colon_nl_rope);
            }

            stmt_list = ast_ast(ast, 1);
            break;
        }
        case DEFAULT_CLAUSE: {
            rope = add_indent(default_colon_nl_rope);
            stmt_list = ast_ast(ast, 0);
            break;
        }
    }

    zc_indent_level++;
    bool fallthrough = false;

    size_t n_stmts;
    ast_asts(stmt_list, &n_stmts);

    if (n_stmts != 0) 
        rope = stmt_list_to_c(rope, stmt_list, &fallthrough);
    else
        rope = add_indent_nl(semi_rope);

    if (!fallthrough)
        rope = rope_new_tree(rope, add_indent_nl(break_semi_rope));
    zc_indent_level--;

    return rope;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %r12
movl (%rdi), %eax
cmpl $0x410a, %eax           # imm = 0x410A
je 0x39a1
xorl %r14d, %r14d
cmpl $0x4109, %eax           # imm = 0x4109
jne 0x39e0
movq %r12, 0x10(%rsp)
movq %r12, %rdi
xorl %esi, %esi
callq 0x27e8
leaq 0x8(%rsp), %r12
movq %rax, %rdi
movq %r12, %rsi
callq 0x2825
cmpq $0x0, (%r12)
je 0x3995
movq %rax, %r15
leaq 0x1038c(%rip), %rbx     # 0x13ca0
leaq 0xf965(%rip), %rbp      # 0x13280
xorl %r14d, %r14d
xorl %r12d, %r12d
leaq 0x104ac(%rip), %rax     # 0x13dd4
movslq (%rax), %r13
movq %rbx, %rax
testq %r13, %r13
je 0x3946
movq %rbx, %rax
movq %rbp, %rdi
movq %rax, %rsi
callq 0xaebf
decq %r13
jne 0x3936
movq %r14, %rdi
movq %rax, %rsi
callq 0xaebf
movq %rax, %r14
movq (%r15,%r12,8), %rdi
callq 0x679a
leaq 0x9fa5(%rip), %rdi      # 0xd909
movq %rax, %rsi
xorl %eax, %eax
callq 0xaef7
movq %r14, %rdi
movq %rax, %rsi
callq 0xaebf
movq %rax, %rdi
leaq 0x1035d(%rip), %rsi     # 0x13ce0
callq 0xaebf
movq %rax, %r14
incq %r12
cmpq 0x8(%rsp), %r12
jb 0x3921
movl $0x1, %esi
movq 0x10(%rsp), %rdi
jmp 0x39d6
leaq 0x1042c(%rip), %rax     # 0x13dd4
movslq (%rax), %rbx
leaq 0x1030e(%rip), %r14     # 0x13cc0
testq %rbx, %rbx
je 0x39d1
leaq 0xf8c2(%rip), %r15      # 0x13280
movq %r15, %rdi
movq %r14, %rsi
callq 0xaebf
movq %rax, %r14
decq %rbx
jne 0x39be
movq %r12, %rdi
xorl %esi, %esi
callq 0x27e8
movq %rax, %rbx
jmp 0x39e0
leaq 0x103ed(%rip), %r12     # 0x13dd4
incl (%r12)
movb $0x0, 0x7(%rsp)
leaq 0x8(%rsp), %r15
movq %rbx, %rdi
movq %r15, %rsi
callq 0x2825
cmpq $0x0, (%r15)
je 0x3a24
leaq 0x7(%rsp), %r15
movq %r14, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x3a63
movq %rax, %rbx
testb $0x1, (%r15)
je 0x3a33
jmp 0x3a4d
leaq 0xfab5(%rip), %rdi      # 0x134e0
callq 0x3397
movq %rax, %rbx
leaq 0xfa46(%rip), %rdi      # 0x13480
callq 0x3397
movq %rbx, %rdi
movq %rax, %rsi
callq 0xaebf
movq %rax, %rbx
decl (%r12)
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq