// File: /workspace/github_c_makefile_star2_O0/pahihu[P]mixal/run.c
// Function: effective_address
static Cell effective_address(Address location)
{
    Byte II, I1, I2, CC = 0, FF = 0;
    Cell MM;

    Cell E, H;
    Address L;
    long N;

    IGNORE_VALUE(CC);
    IGNORE_VALUE(FF);

    H = zero; L = location; N = 0;
A2:
    destructure_cell(safe_fetch(L), MM, II, FF, CC);
    E = MM;
    I2 = II &  7;
    I1 = II >> 3;
    if (0 < I1 && I2 == 0) {
        /* In Mixmaster mode reserved the I1:0 indexing to
         * specify the 5th digit of the address:
         *
         *     +AAAA I1:0 L:R CC => +(I1)AAAA
         */
        E = set_byte(I1, 3, E);
        return E;
    }
    if (0 < I1 && I1 < 7) {
        E = add(E, r[I1]);
    }
    if (0 < I2 && I2 < 7) {
        H = add(H, r[I2]);
    }
    if (I1 == 7 && I2 == 7) {
        N++; H = zero;
    }
/* A3: */
    if (I1 == 7 || I2 == 7) {
        elapsed_time++;
        L = cell_to_address(E); goto A2;
    }
    else {
        E = add(E, H); H = zero;
    }
/* A4: */
    if (N > 0) {
        L = E; N--; goto A2;
    }

    return E;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movl %edi, -0xc(%rbp)
movl $0x0, -0x1c(%rbp)
movl $0x0, -0x20(%rbp)
movq $0x0, -0x38(%rbp)
movl -0xc(%rbp), %eax
movl %eax, -0x3c(%rbp)
movq $0x0, -0x48(%rbp)
jmp 0xb0d1
movl -0x3c(%rbp), %edi
callq 0x94b0
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rax
andq $0x40000000, %rax       # imm = 0x40000000
movq %rax, -0x58(%rbp)
movq -0x50(%rbp), %rax
andq $0x3f, %rax
movl %eax, -0x1c(%rbp)
movq -0x50(%rbp), %rax
sarq $0x6, %rax
movq %rax, -0x50(%rbp)
andq $0x3f, %rax
movl %eax, -0x20(%rbp)
movq -0x50(%rbp), %rax
sarq $0x6, %rax
movq %rax, -0x50(%rbp)
andq $0x3f, %rax
movl %eax, -0x10(%rbp)
movq -0x58(%rbp), %rax
movq -0x50(%rbp), %rcx
sarq $0x6, %rcx
andq $0xfff, %rcx            # imm = 0xFFF
orq %rcx, %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq %rax, -0x30(%rbp)
movl -0x10(%rbp), %eax
andl $0x7, %eax
movl %eax, -0x18(%rbp)
movl -0x10(%rbp), %eax
shrl $0x3, %eax
movl %eax, -0x14(%rbp)
xorl %eax, %eax
cmpl -0x14(%rbp), %eax
jae 0xb17f
cmpl $0x0, -0x18(%rbp)
jne 0xb17f
movl -0x14(%rbp), %edi
movq -0x30(%rbp), %rdx
movl $0x3, %esi
callq 0x3730
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0xb262
xorl %eax, %eax
cmpl -0x14(%rbp), %eax
jae 0xb1a9
cmpl $0x7, -0x14(%rbp)
jae 0xb1a9
movq -0x30(%rbp), %rdi
movl -0x14(%rbp), %eax
movl %eax, %ecx
leaq 0x8be4(%rip), %rax      # 0x13d80
movq (%rax,%rcx,8), %rsi
callq 0x3b50
movq %rax, -0x30(%rbp)
xorl %eax, %eax
cmpl -0x18(%rbp), %eax
jae 0xb1d3
cmpl $0x7, -0x18(%rbp)
jae 0xb1d3
movq -0x38(%rbp), %rdi
movl -0x18(%rbp), %eax
movl %eax, %ecx
leaq 0x8bba(%rip), %rax      # 0x13d80
movq (%rax,%rcx,8), %rsi
callq 0x3b50
movq %rax, -0x38(%rbp)
cmpl $0x7, -0x14(%rbp)
jne 0xb1f3
cmpl $0x7, -0x18(%rbp)
jne 0xb1f3
movq -0x48(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x48(%rbp)
movq $0x0, -0x38(%rbp)
cmpl $0x7, -0x14(%rbp)
je 0xb1ff
cmpl $0x7, -0x18(%rbp)
jne 0xb222
movq 0x8b4a(%rip), %rax      # 0x13d50
addq $0x1, %rax
movq %rax, 0x8b3f(%rip)      # 0x13d50
movq -0x30(%rbp), %rdi
callq 0x47c0
movl %eax, -0x3c(%rbp)
jmp 0xb0cf
movq -0x30(%rbp), %rdi
movq -0x38(%rbp), %rsi
callq 0x3b50
movq %rax, -0x30(%rbp)
movq $0x0, -0x38(%rbp)
cmpq $0x0, -0x48(%rbp)
jle 0xb25a
movq -0x30(%rbp), %rax
movl %eax, -0x3c(%rbp)
movq -0x48(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x48(%rbp)
jmp 0xb0cf
movq -0x30(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x60, %rsp
popq %rbp
retq
nopl (%rax)