// File: /workspace/github_c_makefile_star2_O0/ieyasu[P]funit/generate_code.c
// Function: generate_set
static int generate_set(struct TestSet *set, int *set_i)
{
    int test_i;

    if (set->next)
        generate_set(set->next, set_i);

    (*set_i)++;
    fprintf(fout, "subroutine funit_set%i\n", *set_i);
    fputs("  use funit\n", fout);
    
    if (set->mods)
        print_use(set->mods);
    
    fputs("\n", fout);
    fputs("  implicit none\n\n", fout);
    fputs("  character*1024 :: funit_message_\n", fout);
    fputs("  logical :: funit_passed_\n\n", fout);
    
    if (set->code)
        generate_code(set->code, set->tolerance);

    if (set->tests) {
        size_t max_name = max_test_name_width(set->tests);
        test_i = 0;
        generate_test_call(set, set->tests, &test_i, max_name);
    }
    
    fputs("contains\n\n", fout);
    
    if (set->setup)
        generate_support(set, "setup");
    if (set->teardown)
        generate_support(set, "teardown");
    if (set->tests) {
        test_i = 0;
        if (generate_test(set->tests, &test_i, set->tolerance))
            return -1;
    }

    fprintf(fout, "end subroutine funit_set%i\n", *set_i);

    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
cmpq $0x0, (%rax)
je 0x463a
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movq -0x18(%rbp), %rsi
callq 0x4610
movq -0x18(%rbp), %rax
movl (%rax), %ecx
addl $0x1, %ecx
movl %ecx, (%rax)
movq 0xcc44(%rip), %rdi      # 0x11290
movq -0x18(%rbp), %rax
movl (%rax), %edx
leaq 0x6d83(%rip), %rsi      # 0xb3dc
movb $0x0, %al
callq 0x21a0
movq 0xcc29(%rip), %rsi      # 0x11290
leaq 0x6d02(%rip), %rdi      # 0xb370
callq 0x2130
movq -0x10(%rbp), %rax
cmpq $0x0, 0x10(%rax)
je 0x468b
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x4880
movq 0xcbfe(%rip), %rsi      # 0x11290
leaq 0x775c(%rip), %rdi      # 0xbdf5
callq 0x2130
movq 0xcbeb(%rip), %rsi      # 0x11290
leaq 0x7588(%rip), %rdi      # 0xbc34
callq 0x2130
movq 0xcbd8(%rip), %rsi      # 0x11290
leaq 0x6cbe(%rip), %rdi      # 0xb37d
callq 0x2130
movq 0xcbc5(%rip), %rsi      # 0x11290
leaq 0x6ccf(%rip), %rdi      # 0xb3a1
callq 0x2130
movq -0x10(%rbp), %rax
cmpq $0x0, 0x30(%rax)
je 0x46f8
movq -0x10(%rbp), %rax
movq 0x30(%rax), %rdi
movq -0x10(%rbp), %rax
movsd 0x60(%rax), %xmm0
callq 0x4920
movq -0x10(%rbp), %rax
cmpq $0x0, 0x28(%rax)
je 0x4734
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rdi
callq 0x49f0
movq %rax, -0x28(%rbp)
movl $0x0, -0x1c(%rbp)
movq -0x10(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rsi
movq -0x28(%rbp), %rcx
leaq -0x1c(%rbp), %rdx
callq 0x4a20
movq 0xcb55(%rip), %rsi      # 0x11290
leaq 0x6c7c(%rip), %rdi      # 0xb3be
callq 0x2130
movq -0x10(%rbp), %rax
cmpq $0x0, 0x18(%rax)
je 0x4762
movq -0x10(%rbp), %rdi
leaq 0x6c6c(%rip), %rsi      # 0xb3c9
callq 0x4b30
movq -0x10(%rbp), %rax
cmpq $0x0, 0x20(%rax)
je 0x477d
movq -0x10(%rbp), %rdi
leaq 0x6c57(%rip), %rsi      # 0xb3cf
callq 0x4b30
movq -0x10(%rbp), %rax
cmpq $0x0, 0x28(%rax)
je 0x47b9
movl $0x0, -0x1c(%rbp)
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rdi
movq -0x10(%rbp), %rax
movsd 0x60(%rax), %xmm0
leaq -0x1c(%rbp), %rsi
callq 0x4b90
cmpl $0x0, %eax
je 0x47b7
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x47db
jmp 0x47b9
movq 0xcad0(%rip), %rdi      # 0x11290
movq -0x18(%rbp), %rax
movl (%rax), %edx
leaq 0x6c0b(%rip), %rsi      # 0xb3d8
movb $0x0, %al
callq 0x21a0
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)