// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x8(%rbp)
movq $0x0, -0x10(%rbp)
movq -0x8(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x4c(%rbp)
subl $0x4109, %eax           # imm = 0x4109
je 0x4679
jmp 0x4666
movl -0x4c(%rbp), %eax
subl $0x410a, %eax           # imm = 0x410A
je 0x4748
jmp 0x4769
movq -0x8(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x2a40
movq %rax, %rdi
leaq -0x20(%rbp), %rsi
callq 0x2ad0
movq %rax, -0x28(%rbp)
movq $0x0, -0x30(%rbp)
movq -0x30(%rbp), %rax
cmpq -0x20(%rbp), %rax
jae 0x4734
movq -0x10(%rbp), %rax
movq %rax, -0x60(%rbp)
leaq 0x155d5(%rip), %rdi     # 0x19c90
callq 0x3d80
movq -0x60(%rbp), %rdi
movq %rax, %rsi
callq 0xf2a0
movq %rax, -0x10(%rbp)
movq -0x28(%rbp), %rax
movq -0x30(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x8960
movq %rax, -0x38(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x38(%rbp), %rsi
leaq 0xdff7(%rip), %rdi      # 0x126ef
movb $0x0, %al
callq 0xf320
movq -0x58(%rbp), %rdi
movq %rax, %rsi
callq 0xf2a0
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rdi
leaq 0x155b6(%rip), %rsi     # 0x19cd0
callq 0xf2a0
movq %rax, -0x10(%rbp)
movq -0x30(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x30(%rbp)
jmp 0x469e
movq -0x8(%rbp), %rdi
movl $0x1, %esi
callq 0x2a40
movq %rax, -0x18(%rbp)
jmp 0x4769
leaq 0x15561(%rip), %rdi     # 0x19cb0
callq 0x3d80
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x2a40
movq %rax, -0x18(%rbp)
leaq 0x1565c(%rip), %rax     # 0x19dcc
movl (%rax), %ecx
addl $0x1, %ecx
leaq 0x15650(%rip), %rax     # 0x19dcc
movl %ecx, (%rax)
movb $0x0, -0x39(%rbp)
movq -0x18(%rbp), %rdi
leaq -0x48(%rbp), %rsi
callq 0x2ad0
cmpq $0x0, -0x48(%rbp)
je 0x47ad
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
leaq -0x39(%rbp), %rdx
callq 0x4810
movq %rax, -0x10(%rbp)
jmp 0x47bd
leaq 0x14d1c(%rip), %rdi     # 0x194d0
callq 0x3db0
movq %rax, -0x10(%rbp)
testb $0x1, -0x39(%rbp)
jne 0x47e7
movq -0x10(%rbp), %rax
movq %rax, -0x68(%rbp)
leaq 0x14c9e(%rip), %rdi     # 0x19470
callq 0x3db0
movq -0x68(%rbp), %rdi
movq %rax, %rsi
callq 0xf2a0
movq %rax, -0x10(%rbp)
leaq 0x155de(%rip), %rax     # 0x19dcc
movl (%rax), %ecx
addl $-0x1, %ecx
leaq 0x155d2(%rip), %rax     # 0x19dcc
movl %ecx, (%rax)
movq -0x10(%rbp), %rax
addq $0x70, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)