// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0xdda0
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0xdda0
movq %rax, -0x18(%rbp)
callq 0x1330
movq %rax, -0x28(%rbp)
callq 0x1330
movq %rax, -0x30(%rbp)
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x1b50
movq -0x10(%rbp), %rdi
callq 0xd490
testb $0x1, %al
jne 0x326d
movq -0x10(%rbp), %rdi
callq 0xd350
testb $0x1, %al
jne 0x326d
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rdi
leaq 0xc50d(%rip), %rsi      # 0xf773
movb $0x0, %al
callq 0x6040
movq -0x18(%rbp), %rdi
callq 0xd490
testb $0x1, %al
jne 0x329d
movq -0x18(%rbp), %rdi
callq 0xd350
testb $0x1, %al
jne 0x329d
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdi
leaq 0xc4dd(%rip), %rsi      # 0xf773
movb $0x0, %al
callq 0x6040
movq -0x10(%rbp), %rdi
callq 0x1680
movl %eax, -0x1c(%rbp)
leaq 0x11f60(%rip), %rax     # 0x15210
movq (%rax), %rdi
leaq 0xc086(%rip), %rsi      # 0xf340
movb $0x0, %al
callq 0x10f0
leaq 0x11f48(%rip), %rax     # 0x15210
movq (%rax), %rdi
movslq -0x1c(%rbp), %rax
leaq 0x11e1a(%rip), %rdx     # 0x150f0
shlq $0x2, %rax
addq %rax, %rdx
leaq 0xc4b2(%rip), %rsi      # 0xf796
movb $0x0, %al
callq 0x10f0
leaq 0x11f1e(%rip), %rax     # 0x15210
movq (%rax), %rdi
movq -0x28(%rbp), %rdx
leaq 0xc4b1(%rip), %rsi      # 0xf7b1
movb $0x0, %al
callq 0x10f0
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x1b50
movq -0x18(%rbp), %rdi
callq 0x1680
movl %eax, -0x1c(%rbp)
leaq 0x11ee9(%rip), %rax     # 0x15210
movq (%rax), %rdi
leaq 0xc00f(%rip), %rsi      # 0xf340
movb $0x0, %al
callq 0x10f0
leaq 0x11ed1(%rip), %rax     # 0x15210
movq (%rax), %rdi
movslq -0x1c(%rbp), %rax
leaq 0x11da3(%rip), %rdx     # 0x150f0
shlq $0x2, %rax
addq %rax, %rdx
leaq 0xc43b(%rip), %rsi      # 0xf796
movb $0x0, %al
callq 0x10f0
leaq 0x11ea7(%rip), %rax     # 0x15210
movq (%rax), %rdi
movq -0x28(%rbp), %rdx
leaq 0xc43a(%rip), %rsi      # 0xf7b1
movb $0x0, %al
callq 0x10f0
leaq 0x11e8b(%rip), %rax     # 0x15210
movq (%rax), %rdi
leaq 0xc207(%rip), %rsi      # 0xf596
movb $0x0, %al
callq 0x10f0
movq -0x30(%rbp), %rdi
callq 0x13c0
movq -0x28(%rbp), %rdi
callq 0x1390
leaq 0x11e61(%rip), %rax     # 0x15210
movq (%rax), %rdi
leaq 0xc3ea(%rip), %rsi      # 0xf7a3
movb $0x0, %al
callq 0x10f0
movq -0x30(%rbp), %rdi
callq 0x1390
addq $0x30, %rsp
popq %rbp
retq
nop