// File: /workspace/github_c_makefile_star2_O0/pocari[P]compilerbook-9cc/parser.c
// Function: assign
static Node *assign() {
  Node *node = ternary();
  Token *tk;

  // chibicc だと "=" 以外の +=, -=... 計の演算子は別途 ND_ADD_EQ のような専用のNode種別をつくって処理している
  // https://github.com/rui314/chibicc/commit/05e907d2b8a94103d60148ce90e27ca191ad5446
  // 難しかったので、簡単そうな i += x を構文木上 i = i + x に読み替える方式にしてみる。
  // ただそのせいで、左辺のnodeが複数のnodeで共有されてしまってfree_nodesのときに複数回freeしてしまってエラーになったので、
  // chibccに合わせて今回からastのfreeはやめる
  if (tk = consume("=")) {
    return new_bin_node(ND_ASSIGN, node, assign(), tk);
  } else if (tk = consume("+=")) {
    Node *n = new_add_node(node, assign(), tk);
    return new_bin_node(ND_ASSIGN, node, n, tk);
  } else if (tk = consume("-=")) {
    Node *n = new_sub_node(node, assign(), tk);
    return new_bin_node(ND_ASSIGN, node, n, tk);
  } else if (tk = consume("*=")) {
    Node *n = new_bin_node(ND_MUL, node, assign(), tk);
    return new_bin_node(ND_ASSIGN, node, n, tk);
  } else if (tk = consume("/=")) {
    Node *n = new_bin_node(ND_DIV, node, assign(), tk);
    return new_bin_node(ND_ASSIGN, node, n, tk);
  } else if (tk = consume("<<=")) {
    Node *n = new_bin_node(ND_A_LSHIFT, node, assign(), tk);
    return new_bin_node(ND_ASSIGN, node, n, tk);
  } else if (tk = consume(">>=")) {
    Node *n = new_bin_node(ND_A_RSHIFT, node, assign(), tk);
    return new_bin_node(ND_ASSIGN, node, n, tk);
  } else if (tk = consume("|=")) {
    Node *n = new_bin_node(ND_BIT_OR, node, assign(), tk);
    return new_bin_node(ND_ASSIGN, node, n, tk);
  } else if (tk = consume("&=")) {
    Node *n = new_bin_node(ND_BIT_AND, node, assign(), tk);
    return new_bin_node(ND_ASSIGN, node, n, tk);
  } else if (tk = consume("^=")) {
    Node *n = new_bin_node(ND_BIT_XOR, node, assign(), tk);
    return new_bin_node(ND_ASSIGN, node, n, tk);
  }
  return node;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xb0, %rsp
callq 0x8050
movq %rax, -0x10(%rbp)
leaq 0x6b3b(%rip), %rdi      # 0x10856
callq 0x6780
movq %rax, -0x18(%rbp)
cmpq $0x0, %rax
je 0x9d55
movq -0x10(%rbp), %rax
movq %rax, -0x68(%rbp)
callq 0x9d00
movq -0x68(%rbp), %rsi
movq %rax, %rdx
movq -0x18(%rbp), %rcx
movl $0x16, %edi
callq 0x8140
movq %rax, -0x8(%rbp)
jmp 0xa0b6
leaq 0x6bb3(%rip), %rdi      # 0x1090f
callq 0x6780
movq %rax, -0x18(%rbp)
cmpq $0x0, %rax
je 0x9dab
movq -0x10(%rbp), %rax
movq %rax, -0x70(%rbp)
callq 0x9d00
movq -0x70(%rbp), %rdi
movq %rax, %rsi
movq -0x18(%rbp), %rdx
callq 0x8620
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rsi
movq -0x20(%rbp), %rdx
movq -0x18(%rbp), %rcx
movl $0x16, %edi
callq 0x8140
movq %rax, -0x8(%rbp)
jmp 0xa0b6
leaq 0x6b60(%rip), %rdi      # 0x10912
callq 0x6780
movq %rax, -0x18(%rbp)
cmpq $0x0, %rax
je 0x9e01
movq -0x10(%rbp), %rax
movq %rax, -0x78(%rbp)
callq 0x9d00
movq -0x78(%rbp), %rdi
movq %rax, %rsi
movq -0x18(%rbp), %rdx
callq 0x8750
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rsi
movq -0x28(%rbp), %rdx
movq -0x18(%rbp), %rcx
movl $0x16, %edi
callq 0x8140
movq %rax, -0x8(%rbp)
jmp 0xa0b6
leaq 0x6b0d(%rip), %rdi      # 0x10915
callq 0x6780
movq %rax, -0x18(%rbp)
cmpq $0x0, %rax
je 0x9e5c
movq -0x10(%rbp), %rax
movq %rax, -0x80(%rbp)
callq 0x9d00
movq -0x80(%rbp), %rsi
movq %rax, %rdx
movq -0x18(%rbp), %rcx
movl $0x6, %edi
callq 0x8140
movq %rax, -0x30(%rbp)
movq -0x10(%rbp), %rsi
movq -0x30(%rbp), %rdx
movq -0x18(%rbp), %rcx
movl $0x16, %edi
callq 0x8140
movq %rax, -0x8(%rbp)
jmp 0xa0b6
leaq 0x6ab5(%rip), %rdi      # 0x10918
callq 0x6780
movq %rax, -0x18(%rbp)
cmpq $0x0, %rax
je 0x9ebd
movq -0x10(%rbp), %rax
movq %rax, -0x88(%rbp)
callq 0x9d00
movq -0x88(%rbp), %rsi
movq %rax, %rdx
movq -0x18(%rbp), %rcx
movl $0x7, %edi
callq 0x8140
movq %rax, -0x38(%rbp)
movq -0x10(%rbp), %rsi
movq -0x38(%rbp), %rdx
movq -0x18(%rbp), %rcx
movl $0x16, %edi
callq 0x8140
movq %rax, -0x8(%rbp)
jmp 0xa0b6
leaq 0x6a57(%rip), %rdi      # 0x1091b
callq 0x6780
movq %rax, -0x18(%rbp)
cmpq $0x0, %rax
je 0x9f1e
movq -0x10(%rbp), %rax
movq %rax, -0x90(%rbp)
callq 0x9d00
movq -0x90(%rbp), %rsi
movq %rax, %rdx
movq -0x18(%rbp), %rcx
movl $0xf, %edi
callq 0x8140
movq %rax, -0x40(%rbp)
movq -0x10(%rbp), %rsi
movq -0x40(%rbp), %rdx
movq -0x18(%rbp), %rcx
movl $0x16, %edi
callq 0x8140
movq %rax, -0x8(%rbp)
jmp 0xa0b6
leaq 0x69fa(%rip), %rdi      # 0x1091f
callq 0x6780
movq %rax, -0x18(%rbp)
cmpq $0x0, %rax
je 0x9f7f
movq -0x10(%rbp), %rax
movq %rax, -0x98(%rbp)
callq 0x9d00
movq -0x98(%rbp), %rsi
movq %rax, %rdx
movq -0x18(%rbp), %rcx
movl $0x10, %edi
callq 0x8140
movq %rax, -0x48(%rbp)
movq -0x10(%rbp), %rsi
movq -0x48(%rbp), %rdx
movq -0x18(%rbp), %rcx
movl $0x16, %edi
callq 0x8140
movq %rax, -0x8(%rbp)
jmp 0xa0b6
leaq 0x699d(%rip), %rdi      # 0x10923
callq 0x6780
movq %rax, -0x18(%rbp)
cmpq $0x0, %rax
je 0x9fe0
movq -0x10(%rbp), %rax
movq %rax, -0xa0(%rbp)
callq 0x9d00
movq -0xa0(%rbp), %rsi
movq %rax, %rdx
movq -0x18(%rbp), %rcx
movl $0xd, %edi
callq 0x8140
movq %rax, -0x50(%rbp)
movq -0x10(%rbp), %rsi
movq -0x50(%rbp), %rdx
movq -0x18(%rbp), %rcx
movl $0x16, %edi
callq 0x8140
movq %rax, -0x8(%rbp)
jmp 0xa0b6
leaq 0x693f(%rip), %rdi      # 0x10926
callq 0x6780
movq %rax, -0x18(%rbp)
cmpq $0x0, %rax
je 0xa03e
movq -0x10(%rbp), %rax
movq %rax, -0xa8(%rbp)
callq 0x9d00
movq -0xa8(%rbp), %rsi
movq %rax, %rdx
movq -0x18(%rbp), %rcx
movl $0xe, %edi
callq 0x8140
movq %rax, -0x58(%rbp)
movq -0x10(%rbp), %rsi
movq -0x58(%rbp), %rdx
movq -0x18(%rbp), %rcx
movl $0x16, %edi
callq 0x8140
movq %rax, -0x8(%rbp)
jmp 0xa0b6
leaq 0x68e4(%rip), %rdi      # 0x10929
callq 0x6780
movq %rax, -0x18(%rbp)
cmpq $0x0, %rax
je 0xa09c
movq -0x10(%rbp), %rax
movq %rax, -0xb0(%rbp)
callq 0x9d00
movq -0xb0(%rbp), %rsi
movq %rax, %rdx
movq -0x18(%rbp), %rcx
movl $0x11, %edi
callq 0x8140
movq %rax, -0x60(%rbp)
movq -0x10(%rbp), %rsi
movq -0x60(%rbp), %rdx
movq -0x18(%rbp), %rcx
movl $0x16, %edi
callq 0x8140
movq %rax, -0x8(%rbp)
jmp 0xa0b6
jmp 0xa09e
jmp 0xa0a0
jmp 0xa0a2
jmp 0xa0a4
jmp 0xa0a6
jmp 0xa0a8
jmp 0xa0aa
jmp 0xa0ac
jmp 0xa0ae
movq -0x10(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0xb0, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)