// File: /workspace/github_cpp_makefile_star2_O2/pfnet-research[P]pml/src/parser.cpp
// Function: parser::if_expr(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, unsigned long&)
expr_result_t if_expr(std::string const& input, size_t& pos) {

    EXPECT(if_token, If);

    auto cond_result = expr(input, pos);
    if (cond_result.is_error())
        return cond_result;
    auto cond_expr = cond_result.ok();

    EXPECT(then_token, Then);

    auto true_result = expr(input, pos);
    if (true_result.is_error())
        return true_result;
    auto true_expr = true_result.ok();

    EXPECT(else_token, Else);

    auto false_result = expr(input, pos);
    if (false_result.is_error())
        return false_result;
    auto false_expr = false_result.ok();

    return expr_result_t::ok(make<ast::if_expr_t>(
                cond_expr, true_expr, false_expr));
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x238, %rsp            # imm = 0x238
movq %rdx, %r12
movq %rsi, %r13
movq %rdi, %r14
movq (%rdx), %rdx
leaq 0x160(%rsp), %rbx
pushq $0x3
popq %rcx
movq %rbx, %rdi
callq 0x15bc7
cmpb $0x0, 0x30(%rbx)
je 0x19204
leaq 0x160(%rsp), %rdi
callq 0x1ac66
leaq 0x208(%rsp), %rdi
movq %rax, %rsi
callq 0x1acbe
leaq 0x218(%rsp), %rbx
movq 0x8(%rbx), %rax
addq -0x8(%rbx), %rax
movq %rax, (%r12)
leaq 0x128(%rsp), %rdi
movq %r13, %rsi
movq %r12, %rdx
callq 0x18a5b
cmpb $0x0, 0x158(%rsp)
je 0x19221
leaq 0x128(%rsp), %rdi
callq 0x1b196
leaq 0x10(%rsp), %rdi
movq %rax, %rsi
callq 0xbde0
movq (%r12), %rdx
leaq 0xf0(%rsp), %rdi
pushq $0x5
popq %rcx
movq %r13, %rsi
callq 0x15bc7
cmpb $0x0, 0x120(%rsp)
je 0x19236
leaq 0xf0(%rsp), %rdi
callq 0x1ac66
leaq 0x1d8(%rsp), %rdi
movq %rax, %rsi
callq 0x1acbe
leaq 0x1e8(%rsp), %r15
movq 0x8(%r15), %rax
addq -0x8(%r15), %rax
movq %rax, (%r12)
leaq 0xb8(%rsp), %rdi
movq %r13, %rsi
movq %r12, %rdx
callq 0x18a5b
cmpb $0x0, 0xe8(%rsp)
je 0x19250
leaq 0xb8(%rsp), %rdi
callq 0x1b196
movq %rsp, %rdi
movq %rax, %rsi
callq 0xbde0
movq (%r12), %rdx
leaq 0x80(%rsp), %rdi
pushq $0x4
popq %rcx
movq %r13, %rsi
callq 0x15bc7
cmpb $0x0, 0xb0(%rsp)
je 0x19262
leaq 0x80(%rsp), %rdi
callq 0x1ac66
leaq 0x1a8(%rsp), %rdi
movq %rax, %rsi
callq 0x1acbe
leaq 0x1b8(%rsp), %rbp
movq 0x8(%rbp), %rax
addq -0x8(%rbp), %rax
movq %rax, (%r12)
leaq 0x48(%rsp), %rdi
movq %r13, %rsi
movq %r12, %rdx
callq 0x18a5b
cmpb $0x0, 0x78(%rsp)
je 0x1927c
leaq 0x48(%rsp), %rdi
callq 0x1b196
leaq 0x20(%rsp), %r12
movq %r12, %rdi
movq %rax, %rsi
callq 0xbde0
leaq 0x30(%rsp), %rdi
leaq 0x10(%rsp), %rsi
movq %rsp, %rdx
movq %r12, %rcx
callq 0x1cf95
leaq 0x1a0(%rsp), %rdi
leaq 0x38(%rsp), %r12
andq $0x0, (%rdi)
movb $0x1, 0x30(%r14)
movaps -0x8(%r12), %xmm0
xorps %xmm1, %xmm1
movaps %xmm1, -0x8(%r12)
movups %xmm0, (%r14)
andq $0x0, -0x8(%rdi)
callq 0xa248
movq %r12, %rdi
callq 0xa248
leaq 0x28(%rsp), %rdi
callq 0xa248
jmp 0x19289
leaq 0x160(%rsp), %rdi
callq 0x1ac0e
movq %r14, %rdi
movq %rax, %rsi
callq 0x1b144
jmp 0x192f3
leaq 0x128(%rsp), %rsi
movq %r14, %rdi
callq 0x1b172
jmp 0x192de
leaq 0xf0(%rsp), %rdi
callq 0x1ac0e
movq %r14, %rdi
movq %rax, %rsi
callq 0x1b144
jmp 0x192c7
leaq 0xb8(%rsp), %rsi
movq %r14, %rdi
callq 0x1b172
jmp 0x192b2
leaq 0x80(%rsp), %rdi
callq 0x1ac0e
movq %r14, %rdi
movq %rax, %rsi
callq 0x1b144
jmp 0x1929b
leaq 0x48(%rsp), %rsi
movq %r14, %rdi
callq 0x1b172
leaq 0x48(%rsp), %rdi
callq 0x13e4a
movq %rbp, %rdi
callq 0x9130
leaq 0x90(%rsp), %rdi
callq 0x9130
leaq 0x8(%rsp), %rdi
callq 0xa248
leaq 0xb8(%rsp), %rdi
callq 0x13e4a
movq %r15, %rdi
callq 0x9130
leaq 0x100(%rsp), %rdi
callq 0x9130
leaq 0x18(%rsp), %rdi
callq 0xa248
leaq 0x128(%rsp), %rdi
callq 0x13e4a
movq %rbx, %rdi
callq 0x9130
leaq 0x170(%rsp), %rdi
callq 0x9130
movq %r14, %rax
addq $0x238, %rsp            # imm = 0x238
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
leaq 0x28(%rsp), %rdi
callq 0xa248
jmp 0x19329
jmp 0x19326
movq %rax, %r14
leaq 0x48(%rsp), %rdi
callq 0x13e4a
jmp 0x19338
movq %rax, %r14
movq %rbp, %rdi
callq 0x9130
jmp 0x19347
jmp 0x19344
movq %rax, %r14
leaq 0x90(%rsp), %rdi
callq 0x9130
jmp 0x19359
movq %rax, %r14
leaq 0x8(%rsp), %rdi
callq 0xa248
jmp 0x1936a
jmp 0x19367
movq %rax, %r14
leaq 0xb8(%rsp), %rdi
callq 0x13e4a
jmp 0x1937c
movq %rax, %r14
movq %r15, %rdi
callq 0x9130
jmp 0x1938b
jmp 0x19388
movq %rax, %r14
leaq 0x100(%rsp), %rdi
callq 0x9130
leaq 0x18(%rsp), %rdi
callq 0xa248
jmp 0x193ae
movq %rax, %r14
jmp 0x19398
jmp 0x193ab
movq %rax, %r14
leaq 0x128(%rsp), %rdi
callq 0x13e4a
jmp 0x193c0
movq %rax, %r14
movq %rbx, %rdi
callq 0x9130
jmp 0x193cf
jmp 0x193cc
movq %rax, %r14
leaq 0x170(%rsp), %rdi
callq 0x9130
movq %r14, %rdi
callq 0x94d0