// File: /workspace/github_cpp_makefile_star2_O3/chen3feng[P]error-handling/result.cpp
// Function: GetIntFromFile(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
Result<int> GetIntFromFile(const std::string& filename) {
    // 下面每一步的都依赖上一步操作的结果。
    // TRY 遇到错误就会自动从当前函数返回，否则提取出真正的返回值。
    // 和错误码比，错误不能被无意中忽略；
    // 和异常比，代码更显式看出可能会出错，也一样能自动传播错误，但是代价较低，可控。
    auto&& f = TRY(OpenFile(filename));
    auto&& s = TRY(f.Read());
    auto&& n = TRY(ParseInt(s));
    return n;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa8, %rsp
movq %rdi, %rbx
leaq -0x58(%rbp), %r14
movq %r14, %rdi
callq 0x240b
movq 0x20(%r14), %rax
testq %rax, %rax
je 0x263b
cmpl $0x0, 0x8(%rax)
je 0x263b
movq %rax, -0x88(%rbp)
movq -0x30(%rbp), %rax
movq %rax, -0x80(%rbp)
testq %rax, %rax
je 0x272b
movq 0x39a6(%rip), %rcx      # 0x5fd0
cmpb $0x0, (%rcx)
je 0x2727
incl 0x8(%rax)
jmp 0x272b
leaq -0xb8(%rbp), %r14
movq %r14, -0x10(%r14)
movq -0x58(%rbp), %rsi
movq -0x50(%rbp), %rdx
addq %rsi, %rdx
leaq -0xc8(%rbp), %rdi
callq 0x31d4
leaq -0x58(%rbp), %rdi
callq 0x2e5a
leaq -0x58(%rbp), %rdi
leaq -0xc8(%rbp), %rsi
callq 0x2ea0
movq -0x38(%rbp), %rax
testq %rax, %rax
je 0x26b2
cmpl $0x0, 0x8(%rax)
je 0x26b2
movq %rax, -0x78(%rbp)
movq -0x30(%rbp), %rax
movq %rax, -0x70(%rbp)
testq %rax, %rax
je 0x275c
movq 0x392f(%rip), %rcx      # 0x5fd0
cmpb $0x0, (%rcx)
je 0x2758
incl 0x8(%rax)
jmp 0x275c
leaq -0x98(%rbp), %r15
movq %r15, -0x10(%r15)
movq -0x58(%rbp), %rsi
movq -0x50(%rbp), %rdx
addq %rsi, %rdx
leaq -0xa8(%rbp), %rdi
callq 0x31d4
leaq -0x58(%rbp), %rdi
callq 0x2f1a
leaq -0x58(%rbp), %rdi
leaq -0xa8(%rbp), %rsi
callq 0x250f
movq -0x50(%rbp), %rax
testq %rax, %rax
je 0x271e
cmpl $0x0, 0x8(%rax)
je 0x271e
movq %rax, -0x68(%rbp)
movq -0x48(%rbp), %rax
movq %rax, -0x60(%rbp)
testq %rax, %rax
je 0x2787
movq 0x38bc(%rip), %rcx      # 0x5fd0
cmpb $0x0, (%rcx)
je 0x2783
incl 0x8(%rax)
jmp 0x2787
movb $0x1, %r12b
movl -0x58(%rbp), %r13d
jmp 0x27a6
lock
incl 0x8(%rax)
leaq -0x88(%rbp), %rsi
movq %rbx, %rdi
xorl %edx, %edx
callq 0x2e00
movq -0x80(%rbp), %rdi
testq %rdi, %rdi
je 0x274a
callq 0x301e
leaq -0x58(%rbp), %rdi
callq 0x2e5a
jmp 0x27f9
lock
incl 0x8(%rax)
leaq -0x78(%rbp), %rsi
movq %rbx, %rdi
xorl %edx, %edx
callq 0x2e00
movq -0x70(%rbp), %rdi
testq %rdi, %rdi
je 0x2778
callq 0x301e
leaq -0x58(%rbp), %rdi
callq 0x2f1a
jmp 0x27de
lock
incl 0x8(%rax)
leaq -0x68(%rbp), %rsi
movq %rbx, %rdi
xorl %edx, %edx
callq 0x2e00
movq -0x60(%rbp), %rdi
testq %rdi, %rdi
je 0x27a3
callq 0x301e
xorl %r12d, %r12d
movq -0x48(%rbp), %rdi
testq %rdi, %rdi
je 0x27b4
callq 0x301e
testb %r12b, %r12b
je 0x27c3
movl %r13d, (%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rbx)
movq -0xa8(%rbp), %rdi
cmpq %r15, %rdi
je 0x27de
movq -0x98(%rbp), %rsi
incq %rsi
callq 0x20e0
movq -0xc8(%rbp), %rdi
cmpq %r14, %rdi
je 0x27f9
movq -0xb8(%rbp), %rsi
incq %rsi
callq 0x20e0
movq %rbx, %rax
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq -0x60(%rbp), %rdi
testq %rdi, %rdi
je 0x281f
callq 0x301e
movq -0x48(%rbp), %rdi
testq %rdi, %rdi
je 0x2845
callq 0x301e
jmp 0x2845
movq %rax, %rbx
movq -0x70(%rbp), %rdi
testq %rdi, %rdi
je 0x2865
callq 0x301e
jmp 0x2865
movq %rax, %rbx
movq -0xa8(%rbp), %rdi
cmpq %r15, %rdi
je 0x2886
movq -0x98(%rbp), %rsi
incq %rsi
callq 0x20e0
jmp 0x2886
movq %rax, %rbx
leaq -0x58(%rbp), %rdi
callq 0x2f1a
jmp 0x2886
movq %rax, %rbx
movq -0x80(%rbp), %rdi
testq %rdi, %rdi
je 0x28a6
callq 0x301e
jmp 0x28a6
movq %rax, %rbx
movq -0xc8(%rbp), %rdi
cmpq %r14, %rdi
je 0x28af
movq -0xb8(%rbp), %rsi
incq %rsi
callq 0x20e0
jmp 0x28af
movq %rax, %rbx
leaq -0x58(%rbp), %rdi
callq 0x2e5a
movq %rbx, %rdi
callq 0x2190