// File: /workspace/github_c_makefile_star2_O2/wjmelements[P]evm/src/disassemble.c
// Function: disassembleNextOp
void disassembleNextOp(const char **iter) {
    disassembleWaste(iter);
    op_t op = hexString16ToUint8(*iter);
    *iter += 2;
    if (op >= PUSH1 && op <= PUSH32) {
        pc++;
        disassemblePush(op, iter);
        return;
    }
    statement_t op_statement;
    if (op == JUMPDEST) {
        pcs_append(&jumpdests, pc);
        op_statement = labelForPc(pc);
    } else {
        size_t bufLen = 15;
        char *str = calloc(bufLen, 1);
        char *end = stpncpy(str, opString[op], bufLen);
        size_t strLen = end - str;
        op_statement = (statement_t){
            strLen,
            str,
            bufLen
        };
    }
    int argc = argCount[op];
    if (argc && argc <= stack.num_statements) {
        statement_append(&op_statement, '(');
        while (argc--) {
            statement_t arg = statement_stack_pop(&stack);
            for (size_t i = 0; i < arg.num_schars; i++) {
                statement_append(&op_statement,arg.schars[i]);
            }
            free(arg.schars);
            if (argc) {
                statement_append(&op_statement,',');
            }
        }
        statement_append(&op_statement, ')');
    }
    statement_stack_append(&stack, op_statement);
    if (retCount[op] != 1) {
        for (size_t i = 0; i < stack.num_statements; i++) {
            puts(stack.statements[i].schars);
            free(stack.statements[i].schars);
        }
        stack.num_statements = 0;
    }
    pc++;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdi, %rbx
callq 0xdfa2
movq (%rbx), %r14
movzbl (%r14), %edi
callq 0xe11e
movl %eax, %ebp
shlb $0x4, %bpl
movzbl 0x1(%r14), %edi
callq 0xe11e
movl %eax, %r14d
addb %bpl, %r14b
addq $0x2, (%rbx)
cmpb $0x60, %r14b
jl 0xdccc
movl 0x2050e03(%rip), %r13d  # 0x205ea50
leal 0x1(%r13), %eax
movl %eax, 0x2050df9(%rip)   # 0x205ea50
addb $-0x5f, %r14b
cmpb $0x3, %r14b
ja 0xdd5b
xorl %r15d, %r15d
subb $0x1, %r14b
jb 0xdde4
movq %rbx, %rdi
callq 0xdfa2
shlq $0x4, %r15
movq (%rbx), %rax
cmpb $0x0, (%rax)
je 0xdc9b
leaq 0x1(%rax), %rcx
movq %rcx, (%rbx)
movzbl (%rax), %edi
callq 0xe11e
movzbl %al, %eax
addq %rax, %r15
movq %rbx, %rdi
callq 0xdfa2
shlq $0x4, %r15
movq (%rbx), %rax
cmpb $0x0, (%rax)
je 0xdcc4
leaq 0x1(%rax), %rcx
movq %rcx, (%rbx)
movzbl (%rax), %edi
callq 0xe11e
movzbl %al, %eax
addq %rax, %r15
incl 0x2050d86(%rip)         # 0x205ea50
jmp 0xdc68
cmpb $0x5b, %r14b
jne 0xde27
movl 0x2050d74(%rip), %ebx   # 0x205ea50
movq 0x2050d75(%rip), %rax   # 0x205ea58
movq 0x2050d7e(%rip), %r15   # 0x205ea68
movq 0x2050d6f(%rip), %r14   # 0x205ea60
cmpq %r15, %rax
jb 0xdd37
leaq (%r15,%r15), %rdi
movq %rdi, 0x2050d67(%rip)   # 0x205ea68
pushq $0x4
popq %rsi
callq 0x31b0
movq %rax, %r12
shlq $0x2, %r15
movq %rax, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x31f0
movq %r14, %rdi
callq 0x3040
movq %r12, 0x2050d33(%rip)   # 0x205ea60
movq 0x2050d24(%rip), %rax   # 0x205ea58
movq %r12, %r14
leaq 0x1(%rax), %rcx
movq %rcx, 0x2050d16(%rip)   # 0x205ea58
movl %ebx, (%r14,%rax,4)
leaq 0x18(%rsp), %rdi
movl %ebx, %esi
callq 0xdbab
pushq $0x5b
popq %r12
jmp 0xde68
leal (%r14,%r14), %eax
addb $0x2, %al
movzbl %al, %edi
pushq $0x1
popq %rsi
movq %rdi, 0x30(%rsp)
callq 0x31b0
movq %rax, %r12
movw $0x7830, (%rax)         # imm = 0x7830
addl $0x2, %r13d
movb $0x3, %bpl
subb $0x1, %r14b
jb 0xdef1
movq %rbx, %rdi
callq 0xdfa2
movq (%rbx), %rcx
movb $0x30, %r15b
cmpb $0x0, (%rcx)
movb $0x30, %al
je 0xdda8
leaq 0x1(%rcx), %rax
movq %rax, (%rbx)
movb (%rcx), %al
leal -0x1(%rbp), %ecx
movzbl %cl, %ecx
movb %al, (%r12,%rcx)
movq %rbx, %rdi
callq 0xdfa2
movq (%rbx), %rax
cmpb $0x0, (%rax)
je 0xddcc
leaq 0x1(%rax), %rcx
movq %rcx, (%rbx)
movb (%rax), %r15b
movzbl %bpl, %eax
movb %r15b, (%r12,%rax)
movl %r13d, 0x2050c75(%rip)  # 0x205ea50
incl %r13d
addb $0x2, %bpl
jmp 0xdd80
pushq $0x14
popq %rbx
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0x31b0
movq %rax, %r14
leaq 0x1c74(%rip), %rdx      # 0xfa70
movq %rax, %rdi
movq %rbx, %rsi
movq %r15, %rcx
xorl %eax, %eax
callq 0x3110
cltq
movq %rax, 0x18(%rsp)
movq %r14, 0x20(%rsp)
movq %rbx, 0x28(%rsp)
movq %rbx, 0x10(%rsp)
jmp 0xdf0a
pushq $0xf
popq %rbx
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0x31b0
movq %rax, %r15
movzbl %r14b, %r12d
leaq 0x83ad(%rip), %rax      # 0x161f0
movq (%rax,%r12,8), %rsi
movq %r15, %rdi
movq %rbx, %rdx
callq 0x3220
subq %r15, %rax
movq %rax, 0x18(%rsp)
movq %r15, 0x20(%rsp)
movq $0xf, 0x28(%rsp)
leaq 0x2071(%rip), %rax      # 0xfee0
movzbl (%rax,%r12), %r15d
testq %r15, %r15
je 0xdf27
cmpq %r15, 0x2050bec(%rip)   # 0x205ea70
jb 0xdf27
movb $0x28, %al
leaq 0x18(%rsp), %rbx
movsbl %al, %esi
movq %rbx, %rdi
callq 0xdfda
subl $0x1, %r15d
jb 0xdf1a
movq 0x2050bcf(%rip), %rax   # 0x205ea78
movq 0x2050bc0(%rip), %rcx   # 0x205ea70
decq %rcx
movq %rcx, 0x2050bb6(%rip)   # 0x205ea70
imulq $0x18, %rcx, %rcx
movq (%rax,%rcx), %r13
movq 0x8(%rax,%rcx), %r14
xorl %ebp, %ebp
cmpq %rbp, %r13
je 0xdee0
movsbl (%r14,%rbp), %esi
movq %rbx, %rdi
callq 0xdfda
incq %rbp
jmp 0xdec9
movq %r14, %rdi
callq 0x3040
testl %r15d, %r15d
je 0xde9c
movb $0x2c, %al
jmp 0xde91
movq 0x30(%rsp), %rax
movq %rax, 0x18(%rsp)
movq %r12, 0x20(%rsp)
movq %rax, 0x28(%rsp)
movq %rax, 0x10(%rsp)
movups 0x18(%rsp), %xmm0
movups %xmm0, (%rsp)
callq 0xe048
jmp 0xdf93
leaq 0x18(%rsp), %rdi
pushq $0x29
popq %rsi
callq 0xdfda
movq 0x28(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0x18(%rsp), %xmm0
movups %xmm0, (%rsp)
callq 0xe048
leaq 0x209a(%rip), %rax      # 0xffe0
cmpb $0x1, (%rax,%r12)
je 0xdf8d
pushq $0x8
popq %rbx
xorl %r14d, %r14d
cmpq 0x2050b16(%rip), %r14   # 0x205ea70
jae 0xdf85
movq 0x2050b15(%rip), %rax   # 0x205ea78
movq (%rax,%rbx), %rdi
callq 0x30a0
movq 0x2050b05(%rip), %rax   # 0x205ea78
movq (%rax,%rbx), %rdi
callq 0x3040
incq %r14
addq $0x18, %rbx
jmp 0xdf53
andq $0x0, 0x2050ae3(%rip)   # 0x205ea70
incl 0x2050abd(%rip)         # 0x205ea50
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq