// File: /workspace/github_c_makefile_star2_O3/kieselsteini[P]PiXL-old/lua53.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 %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rsi, %r14
movq %rdi, %r15
movq 0x30(%rdi), %rbx
movl 0x4(%rdi), %eax
movl 0x20(%rdi), %ecx
movl %eax, 0x8(%rdi)
leaq 0x10(%rdi), %r13
cmpl $0x121, %ecx            # imm = 0x121
jne 0x22be6
leaq 0x18(%r15), %rsi
movq %r15, %rdi
callq 0x15dff
movl %eax, 0x10(%r15)
jmp 0x22bf8
leaq 0x20(%r15), %rax
movups (%rax), %xmm0
movups %xmm0, (%r13)
movl $0x121, (%rax)          # imm = 0x121
leaq 0x8(%rsp), %rsi
movq %r15, %rdi
xorl %edx, %edx
callq 0x22f3a
movq %r15, %rdi
movl $0x113, %esi            # imm = 0x113
callq 0x22d61
movl 0x10(%r15), %eax
orl $0x8, %eax
cmpl $0x10a, %eax            # imm = 0x10A
jne 0x22cb0
movq 0x30(%r15), %rdi
leaq 0x8(%rsp), %r12
movq %r12, %rsi
callq 0x107eb
xorl %eax, %eax
leaq 0x20(%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 0x22b15
movl (%r13), %eax
cmpl $0x11f, %eax            # imm = 0x11F
jg 0x22c88
cmpl $0x3b, %eax
je 0x22c8f
jmp 0x22c99
cmpl $0x120, %eax            # imm = 0x120
jne 0x22cfa
movq %r15, %rdi
callq 0x21e58
jmp 0x22c76
addl $0xfffffefc, %eax       # imm = 0xFFFFFEFC
cmpl $0x3, %eax
jae 0x22d01
movq %rbx, %rdi
callq 0x22daa
jmp 0x22d52
movq 0x30(%r15), %rdi
leaq 0x8(%rsp), %r12
movq %r12, %rsi
callq 0x1069b
xorl %eax, %eax
leaq 0x20(%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 0x22d0b
cmpl $0x121, %eax            # imm = 0x121
je 0x22ca3
movq %rbx, %rdi
callq 0xfb84
movl %eax, %ebp
movq %r15, %rdi
callq 0x21c52
movq %rbx, %rdi
callq 0x22daa
movl 0x10(%r15), %eax
andl $-0x2, %eax
cmpl $0x104, %eax            # imm = 0x104
jne 0x22d3e
movq %rbx, %rdi
callq 0xfb84
movq %rbx, %rdi
movq %r14, %rsi
movl %eax, %edx
callq 0xfb01
movl 0x20(%rbx), %eax
movl %eax, 0x24(%rbx)
leaq 0x28(%rbx), %rsi
movq %rbx, %rdi
movl %ebp, %edx
callq 0xfb01
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq