// File: /workspace/github_c_makefile_star2_O0/plvhx[P]dummy-vm/src/ast.c
// Function: vm_ast_process_ternary_addb_imm8_imm8_instruction
static void vm_ast_process_ternary_addb_imm8_imm8_instruction(
    vm_ast_t *ast, FILE *file, void (*visitor)(FILE *file, int opcode)) {
  if (VM_AST_GET_NUM_CHILDS(ast) != 4) {
    return;
  }

  unsigned int is_negated;

  if (!strcasecmp((const char *)VM_AST_GET_REGS_NAME(ast->childs[1]), "r0")) {
    visitor(file, VM_INSN_ADDB_IMM8_IMM8_TO_R0);
  } else if (!strcasecmp((const char *)VM_AST_GET_REGS_NAME(ast->childs[1]),
                         "r1")) {
    visitor(file, VM_INSN_ADDB_IMM8_IMM8_TO_R1);
  } else if (!strcasecmp((const char *)VM_AST_GET_REGS_NAME(ast->childs[1]),
                         "r2")) {
    visitor(file, VM_INSN_ADDB_IMM8_IMM8_TO_R2);
  } else if (!strcasecmp((const char *)VM_AST_GET_REGS_NAME(ast->childs[1]),
                         "r3")) {
    visitor(file, VM_INSN_ADDB_IMM8_IMM8_TO_R3);
  }

  is_negated = VM_AST_GET_NUMBER_VAL(ast->childs[2])[0] == '-' ? 0xff : 0xfa;

  visitor(file, is_negated);
  visitor(file, is_negated == 0xfa
                    ? atoi((char *)VM_AST_GET_NUMBER_VAL(ast->childs[2]))
                    : atoi((char *)VM_AST_GET_NUMBER_VAL(ast->childs[2]) + 1));

  is_negated = VM_AST_GET_NUMBER_VAL(ast->childs[3])[0] == '-' ? 0xff : 0xfa;

  visitor(file, is_negated);
  visitor(file, is_negated == 0xfa
                    ? atoi((char *)VM_AST_GET_NUMBER_VAL(ast->childs[3]))
                    : atoi((char *)VM_AST_GET_NUMBER_VAL(ast->childs[3]) + 1));
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rax
cmpq $0x4, 0x20(%rax)
je 0x1d14
jmp 0x1ed9
movq -0x8(%rbp), %rax
movq 0x38(%rax), %rax
movq 0x8(%rax), %rdi
leaq 0x5374(%rip), %rsi      # 0x709b
callq 0x1040
cmpl $0x0, %eax
jne 0x1d45
movq -0x18(%rbp), %rax
movq -0x10(%rbp), %rdi
movl $0x40, %esi
callq *%rax
jmp 0x1dd3
movq -0x8(%rbp), %rax
movq 0x38(%rax), %rax
movq 0x8(%rax), %rdi
leaq 0x5346(%rip), %rsi      # 0x709e
callq 0x1040
cmpl $0x0, %eax
jne 0x1d73
movq -0x18(%rbp), %rax
movq -0x10(%rbp), %rdi
movl $0x41, %esi
callq *%rax
jmp 0x1dd1
movq -0x8(%rbp), %rax
movq 0x38(%rax), %rax
movq 0x8(%rax), %rdi
leaq 0x531b(%rip), %rsi      # 0x70a1
callq 0x1040
cmpl $0x0, %eax
jne 0x1da1
movq -0x18(%rbp), %rax
movq -0x10(%rbp), %rdi
movl $0x42, %esi
callq *%rax
jmp 0x1dcf
movq -0x8(%rbp), %rax
movq 0x38(%rax), %rax
movq 0x8(%rax), %rdi
leaq 0x52f0(%rip), %rsi      # 0x70a4
callq 0x1040
cmpl $0x0, %eax
jne 0x1dcd
movq -0x18(%rbp), %rax
movq -0x10(%rbp), %rdi
movl $0x43, %esi
callq *%rax
jmp 0x1dcf
jmp 0x1dd1
jmp 0x1dd3
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movq 0x18(%rax), %rax
movzbl (%rax), %edx
movl $0xfa, %eax
movl $0xff, %ecx
cmpl $0x2d, %edx
cmovel %ecx, %eax
movl %eax, -0x1c(%rbp)
movq -0x18(%rbp), %rax
movq -0x10(%rbp), %rdi
movl -0x1c(%rbp), %esi
callq *%rax
movq -0x18(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x28(%rbp)
cmpl $0xfa, -0x1c(%rbp)
jne 0x1e31
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movq 0x18(%rax), %rdi
callq 0x1170
movl %eax, -0x34(%rbp)
jmp 0x1e49
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movq 0x18(%rax), %rdi
addq $0x1, %rdi
callq 0x1170
movl %eax, -0x34(%rbp)
movq -0x30(%rbp), %rax
movq -0x28(%rbp), %rdi
movl -0x34(%rbp), %esi
callq *%rax
movq -0x8(%rbp), %rax
movq 0x48(%rax), %rax
movq 0x18(%rax), %rax
movzbl (%rax), %edx
movl $0xfa, %eax
movl $0xff, %ecx
cmpl $0x2d, %edx
cmovel %ecx, %eax
movl %eax, -0x1c(%rbp)
movq -0x18(%rbp), %rax
movq -0x10(%rbp), %rdi
movl -0x1c(%rbp), %esi
callq *%rax
movq -0x18(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x40(%rbp)
cmpl $0xfa, -0x1c(%rbp)
jne 0x1eb4
movq -0x8(%rbp), %rax
movq 0x48(%rax), %rax
movq 0x18(%rax), %rdi
callq 0x1170
movl %eax, -0x4c(%rbp)
jmp 0x1ecc
movq -0x8(%rbp), %rax
movq 0x48(%rax), %rax
movq 0x18(%rax), %rdi
addq $0x1, %rdi
callq 0x1170
movl %eax, -0x4c(%rbp)
movq -0x48(%rbp), %rax
movq -0x40(%rbp), %rdi
movl -0x4c(%rbp), %esi
callq *%rax
addq $0x50, %rsp
popq %rbp
retq
nop