// File: /workspace/github_c_makefile_star2_O1/tylerneylon[P]APIsWithLua/lua/lparser.c
// Function: test_then_block
static void test_then_block (LexState *ls, int *escapelist) {
  /* test_then_block -> [IF | ELSEIF] cond THEN block */
  BlockCnt bl;
  FuncState *fs = ls->fs;
  expdesc v;
  int jf;  /* instruction to skip 'then' code (if condition is false) */
  luaX_next(ls);  /* skip IF or ELSEIF */
  expr(ls, &v);  /* read condition */
  checknext(ls, TK_THEN);
  if (ls->t.token == TK_GOTO || ls->t.token == TK_BREAK) {
    luaK_goiffalse(ls->fs, &v);  /* will jump to label if condition is true */
    enterblock(fs, &bl, 0);  /* must enter block before 'goto' */
    gotostat(ls, v.t);  /* handle goto/break */
    skipnoopstat(ls);  /* skip other no-op statements */
    if (block_follow(ls, 0)) {  /* 'goto' is the entire block? */
      leaveblock(fs);
      return;  /* and that is it */
    }
    else  /* must skip over 'then' part if condition is false */
      jf = luaK_jump(fs);
  }
  else {  /* regular case (not goto/break) */
    luaK_goiftrue(ls->fs, &v);  /* skip over block if condition is false */
    enterblock(fs, &bl, 0);
    jf = v.f;
  }
  statlist(ls);  /* 'then' part */
  leaveblock(fs);
  if (ls->t.token == TK_ELSE ||
      ls->t.token == TK_ELSEIF)  /* followed by 'else'/'elseif'? */
    luaK_concat(fs, escapelist, luaK_jump(fs));  /* must jump over it */
  luaK_patchtohere(fs, jf);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x30, %rsp
movq %rsi, %r14
movq %rdi, %r15
movq 0x30(%rdi), %rbx
callq 0x16f0a
movq %rsp, %rsi
movq %r15, %rdi
xorl %edx, %edx
callq 0xd37c
movq %r15, %rdi
movl $0x113, %esi            # imm = 0x113
callq 0xd1f5
movl 0x10(%r15), %eax
orl $0x8, %eax
cmpl $0x10a, %eax            # imm = 0x10A
jne 0xd152
movq 0x30(%r15), %rdi
movq %rsp, %r12
movq %r12, %rsi
callq 0x162fa
xorl %eax, %eax
leaq 0x18(%rsp), %rcx
movb %al, 0x12(%rcx)
movb 0x3a(%rbx), %dl
movb %dl, 0x10(%rcx)
movq 0x10(%rbx), %rdx
movq 0x58(%rdx), %rdx
movl 0x28(%rdx), %esi
movl %esi, 0x8(%rcx)
movl 0x18(%rdx), %edx
movl %edx, 0xc(%rcx)
movb %al, 0x11(%rcx)
movq 0x18(%rbx), %rax
movq %rax, (%rcx)
movq %rcx, 0x18(%rbx)
movl 0x10(%r12), %esi
movq %r15, %rdi
callq 0xd01a
movl 0x10(%r15), %eax
cmpl $0x11f, %eax            # imm = 0x11F
jg 0xd12a
cmpl $0x3b, %eax
je 0xd131
jmp 0xd13b
cmpl $0x120, %eax            # imm = 0x120
jne 0xd19a
movq %r15, %rdi
callq 0xc5c7
jmp 0xd118
addl $0xfffffefc, %eax       # imm = 0xFFFFFEFC
cmpl $0x3, %eax
jae 0xd1a1
movq %rbx, %rdi
callq 0xd204
jmp 0xd1e8
movq 0x30(%r15), %rdi
movq %rsp, %r12
movq %r12, %rsi
callq 0x16183
xorl %eax, %eax
leaq 0x18(%rsp), %rcx
movb %al, 0x12(%rcx)
movb 0x3a(%rbx), %dl
movb %dl, 0x10(%rcx)
movq 0x10(%rbx), %rdx
movq 0x58(%rdx), %rdx
movl 0x28(%rdx), %esi
movl %esi, 0x8(%rcx)
movl 0x18(%rdx), %edx
movl %edx, 0xc(%rcx)
movb %al, 0x11(%rcx)
movq 0x18(%rbx), %rax
movq %rax, (%rcx)
movq %rcx, 0x18(%rbx)
movl 0x14(%r12), %ebp
jmp 0xd1ab
cmpl $0x121, %eax            # imm = 0x121
je 0xd145
movq %rbx, %rdi
callq 0x1577c
movl %eax, %ebp
movq %r15, %rdi
callq 0xc3c2
movq %rbx, %rdi
callq 0xd204
movl 0x10(%r15), %eax
andl $-0x2, %eax
cmpl $0x104, %eax            # imm = 0x104
jne 0xd1de
movq %rbx, %rdi
callq 0x1577c
movq %rbx, %rdi
movq %r14, %rsi
movl %eax, %edx
callq 0x156f5
movq %rbx, %rdi
movl %ebp, %esi
callq 0x157e8
addq $0x30, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq