// File: /workspace/github_c_makefile_star2_O0/afi-lambda[P]a_little_smalltalk/src/primitive.c
// Function: trinaryPrims
static int trinaryPrims(int number, object firstarg, object secondarg, object thirdarg)
{
    char *bp, *tp, buffer[256];
    unsigned int i, j;
    object returnedObject;

    returnedObject = firstarg;
    switch (number)
    {
    case 1: /* basicAt:Put: */
        if (!isInteger(secondarg))
            sysError("non integer index", "basicAtPut");
        fprintf(stderr, "IN BASICATPUT %d %d %d\n", firstarg,
                intValue(secondarg), thirdarg);
        fieldAtPut(firstarg, intValue(secondarg), thirdarg)
        ;
        break;

    case 2: /* basicAt:Put: for bytes */
        if (!isInteger(secondarg))
            sysError("non integer index", "byteAtPut");
        if (!isInteger(thirdarg))
            sysError("assigning non int", "to byte");
        byteAtPut(firstarg, intValue(secondarg), intValue(thirdarg));
        break;

    case 3: /* string copyFrom:to: */
        bp = charPtr(firstarg);
        if ((!isInteger(secondarg)) || (!isInteger(thirdarg)))
            sysError("non integer index", "copyFromTo");
        i = intValue(secondarg);
        j = intValue(thirdarg);
        tp = buffer;
        if (i <= strlen(bp))
            for (; (i <= j) && bp[i - 1]; i++)
                *tp++ = bp[i - 1];
        *tp = '\0';
        returnedObject = newStString(buffer);
        break;

    case 9: /* compile method */
        setInstanceVariables(firstarg);
        if (parse(thirdarg, charPtr(secondarg), false))
        {
            flushCache(basicAt(thirdarg, messageInMethod), firstarg);
            returnedObject = trueobj;
        }
        else
            returnedObject = falseobj;
        break;

    default: /* unknown primitive */
        sysError("unknown primitive", "trinaryPrims");
        break;
    }
    return (returnedObject);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x170, %rsp            # imm = 0x170
movw %cx, %ax
movw %dx, %cx
movw %si, %dx
movl %edi, -0x4(%rbp)
movw %dx, -0x6(%rbp)
movw %cx, -0x8(%rbp)
movw %ax, -0xa(%rbp)
movw -0x6(%rbp), %ax
movw %ax, -0x12a(%rbp)
movl -0x4(%rbp), %eax
decl %eax
movl %eax, %ecx
movq %rcx, -0x138(%rbp)
subl $0x8, %eax
ja 0x7916
movq -0x138(%rbp), %rax
leaq 0x5061(%rip), %rcx      # 0xc584
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movswl -0x8(%rbp), %edi
callq 0x2fb0
cmpl $0x0, %eax
jne 0x754d
leaq 0x51c3(%rip), %rdi      # 0xc704
leaq 0x51e2(%rip), %rsi      # 0xc72a
callq 0x63f0
movq 0x7aa4(%rip), %rax      # 0xeff8
movq (%rax), %rax
movq %rax, -0x148(%rbp)
movswl -0x6(%rbp), %eax
movl %eax, -0x13c(%rbp)
movswl -0x8(%rbp), %edi
callq 0x3470
movq -0x148(%rbp), %rdi
movl -0x13c(%rbp), %edx
movl %eax, %ecx
movswl -0xa(%rbp), %r8d
leaq 0x51a9(%rip), %rsi      # 0xc735
movb $0x0, %al
callq 0x2170
movswl -0x8(%rbp), %edi
callq 0x3470
movl %eax, %ecx
leaq 0x22313(%rip), %rax     # 0x298b8
movl %ecx, (%rax)
movswl -0x6(%rbp), %eax
sarl %eax
movslq %eax, %rcx
leaq 0x8ca9(%rip), %rax      # 0x10260
shlq $0x4, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
leaq 0x222ef(%rip), %rcx     # 0x298b8
movl (%rcx), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movswl (%rax,%rcx,2), %edi
callq 0x3020
movw -0xa(%rbp), %ax
movswl -0x6(%rbp), %ecx
sarl %ecx
movslq %ecx, %rdx
leaq 0x8c72(%rip), %rcx      # 0x10260
shlq $0x4, %rdx
addq %rdx, %rcx
movq 0x8(%rcx), %rcx
leaq 0x222b8(%rip), %rdx     # 0x298b8
movl (%rdx), %edx
subl $0x1, %edx
movslq %edx, %rdx
movw %ax, (%rcx,%rdx,2)
movswl %ax, %edi
callq 0x2fd0
jmp 0x7929
movswl -0x8(%rbp), %edi
callq 0x2fb0
cmpl $0x0, %eax
jne 0x763a
leaq 0x50d6(%rip), %rdi      # 0xc704
leaq 0x4b79(%rip), %rsi      # 0xc1ae
callq 0x63f0
movswl -0xa(%rbp), %edi
callq 0x2fb0
cmpl $0x0, %eax
jne 0x765b
leaq 0x50fe(%rip), %rdi      # 0xc74d
leaq 0x5109(%rip), %rsi      # 0xc75f
callq 0x63f0
movw -0x6(%rbp), %ax
movw %ax, -0x14a(%rbp)
movswl -0x8(%rbp), %edi
callq 0x3470
movl %eax, -0x150(%rbp)
movswl -0xa(%rbp), %edi
callq 0x3470
movl -0x150(%rbp), %esi
movl %eax, %edx
movw -0x14a(%rbp), %ax
movswl %ax, %edi
callq 0x31d0
jmp 0x7929
movw -0x6(%rbp), %ax
leaq 0x2220b(%rip), %rcx     # 0x298b0
movw %ax, (%rcx)
movswl %ax, %edi
callq 0x2fb0
cmpl $0x0, %eax
je 0x76df
leaq 0x221f4(%rip), %rax     # 0x298b0
movswl (%rax), %eax
sarl %eax
movslq %eax, %rcx
leaq 0x8b95(%rip), %rax      # 0x10260
shlq $0x4, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
movq %rax, -0x158(%rbp)
jmp 0x7707
leaq 0x221ca(%rip), %rax     # 0x298b0
movswl (%rax), %eax
sarl %eax
movslq %eax, %rcx
leaq 0x8b6b(%rip), %rax      # 0x10260
shlq $0x4, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
movq %rax, -0x158(%rbp)
movq -0x158(%rbp), %rax
movq %rax, -0x18(%rbp)
movswl -0x8(%rbp), %edi
callq 0x2fb0
cmpl $0x0, %eax
je 0x772e
movswl -0xa(%rbp), %edi
callq 0x2fb0
cmpl $0x0, %eax
jne 0x7741
leaq 0x4fcf(%rip), %rdi      # 0xc704
leaq 0x502b(%rip), %rsi      # 0xc767
callq 0x63f0
movswl -0x8(%rbp), %edi
callq 0x3470
movl %eax, -0x124(%rbp)
movswl -0xa(%rbp), %edi
callq 0x3470
movl %eax, -0x128(%rbp)
leaq -0x120(%rbp), %rax
movq %rax, -0x20(%rbp)
movl -0x124(%rbp), %eax
movq %rax, -0x160(%rbp)
movq -0x18(%rbp), %rdi
callq 0x2090
movq %rax, %rcx
movq -0x160(%rbp), %rax
cmpq %rcx, %rax
ja 0x7808
jmp 0x7791
movl -0x124(%rbp), %ecx
xorl %eax, %eax
cmpl -0x128(%rbp), %ecx
movb %al, -0x161(%rbp)
ja 0x77c6
movq -0x18(%rbp), %rax
movl -0x124(%rbp), %ecx
subl $0x1, %ecx
movl %ecx, %ecx
movsbl (%rax,%rcx), %eax
cmpl $0x0, %eax
setne %al
movb %al, -0x161(%rbp)
movb -0x161(%rbp), %al
testb $0x1, %al
jne 0x77d2
jmp 0x7806
movq -0x18(%rbp), %rax
movl -0x124(%rbp), %ecx
subl $0x1, %ecx
movl %ecx, %ecx
movb (%rax,%rcx), %cl
movq -0x20(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x20(%rbp)
movb %cl, (%rax)
movl -0x124(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x124(%rbp)
jmp 0x7791
jmp 0x7808
movq -0x20(%rbp), %rax
movb $0x0, (%rax)
leaq -0x120(%rbp), %rdi
callq 0x45d0
movw %ax, -0x12a(%rbp)
jmp 0x7929
movswl -0x6(%rbp), %edi
callq 0x9150
movw -0xa(%rbp), %ax
movw %ax, -0x164(%rbp)
movw -0x8(%rbp), %ax
leaq 0x2206a(%rip), %rcx     # 0x298b0
movw %ax, (%rcx)
movswl %ax, %edi
callq 0x2fb0
cmpl $0x0, %eax
je 0x7880
leaq 0x22053(%rip), %rax     # 0x298b0
movswl (%rax), %eax
sarl %eax
movslq %eax, %rcx
leaq 0x89f4(%rip), %rax      # 0x10260
shlq $0x4, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
movq %rax, -0x170(%rbp)
jmp 0x78a8
leaq 0x22029(%rip), %rax     # 0x298b0
movswl (%rax), %eax
sarl %eax
movslq %eax, %rcx
leaq 0x89ca(%rip), %rax      # 0x10260
shlq $0x4, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
movq %rax, -0x170(%rbp)
movw -0x164(%rbp), %ax
movq -0x170(%rbp), %rsi
xorl %edx, %edx
movswl %ax, %edi
callq 0x92c0
cmpl $0x0, %eax
je 0x7903
movswl -0xa(%rbp), %eax
sarl %eax
movslq %eax, %rcx
leaq 0x898b(%rip), %rax      # 0x10260
shlq $0x4, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
movw 0x2(%rax), %ax
movswl %ax, %edi
movswl -0x6(%rbp), %esi
callq 0x4650
leaq 0x226fb(%rip), %rax     # 0x29ff2
movw (%rax), %ax
movw %ax, -0x12a(%rbp)
jmp 0x7914
leaq 0x226ea(%rip), %rax     # 0x29ff4
movw (%rax), %ax
movw %ax, -0x12a(%rbp)
jmp 0x7929
leaq 0x4ba2(%rip), %rdi      # 0xc4bf
leaq 0x4e4e(%rip), %rsi      # 0xc772
callq 0x63f0
movswl -0x12a(%rbp), %eax
addq $0x170, %rsp            # imm = 0x170
popq %rbp
retq
nopl (%rax)