// File: /workspace/github_c_makefile_star2_O0/sharmaeklavya2[P]cerplag/compiler.c
// Function: get_composite_type
valtype_t get_composite_type(op_t op, valtype_t type1, valtype_t type2, int line, int col) {
    if(type1 == TYPE_ERROR || type2 == TYPE_ERROR)
        return TYPE_ERROR;
    if(type1 != type2) {
        print_type_error(op, type1, type2, line, col);
        return TYPE_ERROR;
    }
    switch(op) {
        case OP_PLUS:
        case OP_MINUS:
        case OP_MUL:
        case OP_DIV:
            if(type1 == TYPE_INTEGER || type1 == TYPE_REAL)
                return type1;
            else
                print_type_error(op, type1, type2, line, col);
            break;
        /*
        case OP_DIV:
            if(type1 == TYPE_INTEGER || type1 == TYPE_REAL)
                return TYPE_REAL;
            else
                print_type_error(op, type1, type2, line, col);
            break;
        */
        case OP_GT:
        case OP_LT:
        case OP_GE:
        case OP_LE:
        case OP_EQ:
        case OP_NE:
            if(type1 == TYPE_INTEGER || type1 == TYPE_REAL)
                return TYPE_BOOLEAN;
            else
                print_type_error(op, type1, type2, line, col);
            break;
        case OP_AND:
        case OP_OR:
            if(type1 == TYPE_BOOLEAN)
                return TYPE_BOOLEAN;
            else
                print_type_error(op, type1, type2, line, col);
            break;
        default:
            fprintf(stderr, "Invalid operand %d\n", op);
    }
    return TYPE_ERROR;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movl %edi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movl %ecx, -0x14(%rbp)
movl %r8d, -0x18(%rbp)
cmpl $0x0, -0xc(%rbp)
je 0xd734
cmpl $0x0, -0x10(%rbp)
jne 0xd740
movl $0x0, -0x4(%rbp)
jmp 0xd842
movl -0xc(%rbp), %eax
cmpl -0x10(%rbp), %eax
je 0xd769
movl -0x8(%rbp), %edi
movl -0xc(%rbp), %esi
movl -0x10(%rbp), %edx
movl -0x14(%rbp), %ecx
movl -0x18(%rbp), %r8d
callq 0xd620
movl $0x0, -0x4(%rbp)
jmp 0xd842
movl -0x8(%rbp), %eax
movl %eax, -0x1c(%rbp)
subl $0x2, %eax
jb 0xd7a0
jmp 0xd776
movl -0x1c(%rbp), %eax
addl $-0x2, %eax
subl $0x6, %eax
jb 0xd7ce
jmp 0xd783
movl -0x1c(%rbp), %eax
addl $-0x8, %eax
subl $0x2, %eax
jb 0xd7a0
jmp 0xd790
movl -0x1c(%rbp), %eax
addl $-0xa, %eax
subl $0x2, %eax
jb 0xd7fa
jmp 0xd820
cmpl $0x1, -0xc(%rbp)
je 0xd7ac
cmpl $0x2, -0xc(%rbp)
jne 0xd7b7
movl -0xc(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0xd842
movl -0x8(%rbp), %edi
movl -0xc(%rbp), %esi
movl -0x10(%rbp), %edx
movl -0x14(%rbp), %ecx
movl -0x18(%rbp), %r8d
callq 0xd620
jmp 0xd83b
cmpl $0x1, -0xc(%rbp)
je 0xd7da
cmpl $0x2, -0xc(%rbp)
jne 0xd7e3
movl $0x3, -0x4(%rbp)
jmp 0xd842
movl -0x8(%rbp), %edi
movl -0xc(%rbp), %esi
movl -0x10(%rbp), %edx
movl -0x14(%rbp), %ecx
movl -0x18(%rbp), %r8d
callq 0xd620
jmp 0xd83b
cmpl $0x3, -0xc(%rbp)
jne 0xd809
movl $0x3, -0x4(%rbp)
jmp 0xd842
movl -0x8(%rbp), %edi
movl -0xc(%rbp), %esi
movl -0x10(%rbp), %edx
movl -0x14(%rbp), %ecx
movl -0x18(%rbp), %r8d
callq 0xd620
jmp 0xd83b
movq 0xc7d1(%rip), %rax      # 0x19ff8
movq (%rax), %rdi
movl -0x8(%rbp), %edx
leaq 0x7b26(%rip), %rsi      # 0x1535a
movb $0x0, %al
callq 0x3120
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)