// File: /workspace/github_c_makefile_star2_O1/sisshiki1969[P]monocc/src/codegen.c
// Function: gen_lor
void gen_lor(Node *node) {
  Type *l_ty = type(node->lhs);
  Type *r_ty = type(node->rhs);
  int reg_mode;
  char *true_label = new_label();
  char *exit_label = new_label();
  gen(node->lhs);

  if (!is_arith(l_ty) && !is_ptr(l_ty))
    error_at_node(node->lhs, "Illegal operation. (Type mismatch)");
  if (!is_arith(r_ty) && !is_ptr(r_ty))
    error_at_node(node->rhs, "Illegal operation. (Type mismatch)");

  reg_mode = reg_size(l_ty);
  fprintf(output, "\tpop  rax\n");
  fprintf(output, "\tcmp  %s, 0\n", reg_rax[reg_mode]);
  fprintf(output, "\tjne  %s\n", true_label);

  gen(node->rhs);

  reg_mode = reg_size(r_ty);
  fprintf(output, "\tpop  rax\n");
  fprintf(output, "\tcmp  %s, 0\n", reg_rax[reg_mode]);
  fprintf(output, "\tjne  %s\n", true_label);

  fprintf(output, "\tmov  rax, 0\n");
  emit_jmp(exit_label);

  emit_label(true_label);
  fprintf(output, "\tmov  rax, 1\n");
  emit_label(exit_label);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %r15
movq 0x8(%rdi), %rdi
callq 0xb354
movq %rax, %r13
movq 0x10(%r15), %rdi
callq 0xb354
movq %rax, %r12
callq 0x1958
movq %rax, 0x8(%rsp)
callq 0x1958
movq %rax, 0x10(%rsp)
movq 0x8(%r15), %rdi
callq 0x1ead
movq %r13, %rdi
callq 0xaef0
testb %al, %al
jne 0x34a1
movq %r13, %rdi
callq 0xaea0
testb %al, %al
jne 0x34a1
movq 0x8(%r15), %rdi
leaq 0x92e9(%rip), %rsi      # 0xc783
xorl %eax, %eax
callq 0x552e
movq %r12, %rdi
callq 0xaef0
testb %al, %al
jne 0x34cb
movq %r12, %rdi
callq 0xaea0
testb %al, %al
jne 0x34cb
movq 0x10(%r15), %rdi
leaq 0x92bf(%rip), %rsi      # 0xc783
xorl %eax, %eax
callq 0x552e
movq %r13, %rdi
callq 0x1b36
movl %eax, %ebx
leaq 0xfd44(%rip), %r14      # 0x13220
movq (%r14), %rcx
leaq 0x8e6a(%rip), %rdi      # 0xc350
movl $0xa, %esi
movl $0x1, %edx
callq 0x1190
movq (%r14), %rdi
movslq %ebx, %rax
leaq 0xfbfe(%rip), %rcx      # 0x13100
leaq (%rcx,%rax,4), %rdx
leaq 0x9299(%rip), %rbp      # 0xc7a6
movq %rbp, %rsi
xorl %eax, %eax
callq 0x10f0
movq (%r14), %rdi
leaq 0x92a0(%rip), %rbx      # 0xc7c1
movq %rbx, %rsi
movq 0x8(%rsp), %r13
movq %r13, %rdx
xorl %eax, %eax
callq 0x10f0
movq 0x10(%r15), %rdi
callq 0x1ead
movq %r12, %rdi
callq 0x1b36
movl %eax, %r15d
movq (%r14), %rcx
movl $0xa, %esi
movl $0x1, %edx
leaq 0x8df5(%rip), %rdi      # 0xc350
callq 0x1190
movq (%r14), %rdi
movslq %r15d, %rax
leaq 0xfb93(%rip), %rcx      # 0x13100
leaq (%rcx,%rax,4), %rdx
movq %rbp, %rsi
xorl %eax, %eax
callq 0x10f0
movq (%r14), %rdi
movq %rbx, %rsi
movq %r13, %rdx
xorl %eax, %eax
callq 0x10f0
movq (%r14), %rcx
leaq 0x9011(%rip), %rdi      # 0xc5a6
movl $0xd, %esi
movl $0x1, %edx
callq 0x1190
movq (%r14), %rdi
leaq 0x8bd2(%rip), %rsi      # 0xc180
movq 0x10(%rsp), %r15
movq %r15, %rdx
xorl %eax, %eax
callq 0x10f0
movq (%r14), %rdi
leaq 0x8bb4(%rip), %rbx      # 0xc17b
movq %rbx, %rsi
movq %r13, %rdx
xorl %eax, %eax
callq 0x10f0
movq (%r14), %rcx
leaq 0x91d5(%rip), %rdi      # 0xc7b3
movl $0xd, %esi
movl $0x1, %edx
callq 0x1190
movq (%r14), %rdi
movq %rbx, %rsi
movq %r15, %rdx
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x10f0