// File: /workspace/github_c_makefile_star2_O2/nerves-project[P]nerves_initramfs/src/nerves_initramfs.c
// Function: main
int main(int argc, char *argv[])
{
    info("version " PROGRAM_VERSION_STR
#ifdef DEBUG
         " [DEBUG]"
#endif
            );

    if (getpid() != 1)
       fatal("Must be pid 1");

    setup_initramfs();

    // Initialize scripting environment
    initialize_script_defaults(argc, argv);

    eval_file("/nerves_initramfs.conf");

    if (get_variable_as_boolean("run_repl"))
        repl();

    // Mount the root filesystem
    const char *rootfs_spec = get_variable_as_string("rootfs.path");
    char resolved_rootfs_path[BLOCK_DEVICE_PATH_LEN];
    if (resolve_block_device_spec(rootfs_spec, resolved_rootfs_path) < 0)
        fatal("Can't continue since '%s' does not exist.", rootfs_spec);

    const char *rootfs_fstype = get_variable_as_string("rootfs.fstype");
    if (get_variable_as_boolean("rootfs.encrypted"))
        mount_encrypted_fs(resolved_rootfs_path,
                           rootfs_fstype,
                           get_variable_as_string("rootfs.cipher"),
                           get_variable_as_string("rootfs.secret"));
    else
        mount_fs(resolved_rootfs_path, rootfs_fstype);

    // Finalize our setup of the root filesystem
    create_rootdisk_symlinks(resolved_rootfs_path);

    // Switch over to the new root filesystem
    switch_root();

    // Launch the real init. It's always /sbin/init with Buildroot.
    execv("/sbin/init", argv);

    fatal("Couldn't run /sbin/init: %s", strerror(errno));
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x4058, %rsp           # imm = 0x4058
movq %rsi, %rbx
movl %edi, %ebp
leaq 0x5914(%rip), %rdi      # 0x8075
xorl %eax, %eax
callq 0x2ee4
callq 0x2150
cmpl $0x1, %eax
je 0x2780
leaq 0x590a(%rip), %rdi      # 0x8083
xorl %eax, %eax
callq 0x2fc5
leaq 0x59c5(%rip), %rdi      # 0x814c
movl $0x1ed, %esi            # imm = 0x1ED
callq 0x20d0
leaq 0x59df(%rip), %r14      # 0x8177
movq %r14, %rdi
movl $0x1ed, %esi            # imm = 0x1ED
callq 0x20d0
leaq 0x59e2(%rip), %rdi      # 0x818e
movl $0x16d, %esi            # imm = 0x16D
callq 0x20d0
leaq 0x59e2(%rip), %rdi      # 0x819f
movl $0x16d, %esi            # imm = 0x16D
callq 0x20d0
leaq 0x5983(%rip), %rdi      # 0x8151
leaq 0x5985(%rip), %r8       # 0x815a
pushq $0xa
popq %rcx
movq %r14, %rsi
movq %rdi, %rdx
callq 0x21a0
testl %eax, %eax
jns 0x27f5
leaq 0x597d(%rip), %rdi      # 0x816b
xorl %eax, %eax
callq 0x2ee4
leaq 0x5992(%rip), %rsi      # 0x818e
leaq 0x5979(%rip), %rdi      # 0x817c
pushq $0xe
popq %rcx
movq %rdi, %rdx
xorl %r8d, %r8d
callq 0x21a0
testl %eax, %eax
jns 0x2823
leaq 0x5966(%rip), %rdi      # 0x8182
xorl %eax, %eax
callq 0x2ee4
leaq 0x5975(%rip), %rsi      # 0x819f
leaq 0x596f(%rip), %rdi      # 0x81a0
pushq $0xe
popq %rcx
movq %rdi, %rdx
xorl %r8d, %r8d
callq 0x21a0
testl %eax, %eax
jns 0x2851
leaq 0x5949(%rip), %rdi      # 0x8193
xorl %eax, %eax
callq 0x2ee4
xorl %eax, %eax
callq 0x4b4c
leaq 0xad41(%rip), %rdi      # 0xd5a0
callq 0x317c
leaq 0x587c(%rip), %rdi      # 0x80e7
leaq 0x5933(%rip), %rsi      # 0x81a5
callq 0x5204
leaq 0x5833(%rip), %rdi      # 0x80b1
leaq 0x5929(%rip), %rsi      # 0x81ae
callq 0x5204
leaq 0x5864(%rip), %rdi      # 0x80f5
xorl %esi, %esi
callq 0x521c
leaq 0x5867(%rip), %rdi      # 0x8106
leaq 0x5b63(%rip), %r14      # 0x8409
movq %r14, %rsi
callq 0x5204
leaq 0x585f(%rip), %rdi      # 0x8114
movq %r14, %rsi
callq 0x5204
leaq 0x6dc0(%rip), %rdi      # 0x9684
leaq 0x58f2(%rip), %rsi      # 0x81bd
callq 0x5204
leaq 0x58f3(%rip), %rdi      # 0x81ca
xorl %esi, %esi
callq 0x521c
leaq 0x58f6(%rip), %rdi      # 0x81db
xorl %esi, %esi
callq 0x521c
leaq 0x58fb(%rip), %rdi      # 0x81ee
movl $0x100, %esi            # imm = 0x100
callq 0x5233
leaq 0x58fa(%rip), %rdi      # 0x81fe
movl $0x100, %esi            # imm = 0x100
callq 0x5233
leaq 0x5793(%rip), %rdi      # 0x80a8
xorl %esi, %esi
callq 0x521c
movslq %ebp, %r12
pushq $0x1
popq %r13
pushq $0x3d
popq %rbp
pushq $0x1
popq %r14
cmpq %r12, %r13
jge 0x296b
movq (%rbx,%r13,8), %r15
cmpb $0x2d, (%r15)
je 0x2966
movq %r15, %rdi
movl %ebp, %esi
callq 0x21e0
testq %rax, %rax
je 0x295b
movb $0x0, (%rax)
incq %rax
movq %r15, %rdi
movq %rax, %rsi
callq 0x5204
jmp 0x2966
movq %r15, %rdi
movl %r14d, %esi
callq 0x521c
incq %r13
jmp 0x292a
leaq 0x571f(%rip), %rdi      # 0x8091
callq 0x5261
leaq 0x572a(%rip), %rdi      # 0x80a8
callq 0x51d2
testb %al, %al
je 0x29dc
leaq 0x5880(%rip), %rdi      # 0x820e
xorl %eax, %eax
callq 0x21f0
leaq 0x5877(%rip), %r14      # 0x8213
leaq 0xac8d(%rip), %r12      # 0xd630
movq %r14, %rdi
callq 0x65ba
testq %rax, %rax
je 0x29dc
movq %rax, %r15
movq %rax, %rdi
callq 0x6d61
movq %r15, %rdi
callq 0x524a
movq (%r12), %rdi
testq %rdi, %rdi
je 0x29a3
callq 0x50fa
movq 0x8(%rax), %rdi
callq 0x20f0
jmp 0x29a3
leaq 0x56ce(%rip), %rdi      # 0x80b1
callq 0x51af
movq %rax, %r14
leaq 0x10(%rsp), %rsi
movq %rax, %rdi
callq 0x7649
testl %eax, %eax
jns 0x2a0d
leaq 0x56ba(%rip), %rdi      # 0x80bd
movq %r14, %rsi
xorl %eax, %eax
callq 0x2fc5
leaq 0x56d3(%rip), %rdi      # 0x80e7
callq 0x51af
movq %rax, %r14
leaq 0x56d2(%rip), %rdi      # 0x80f5
callq 0x51d2
testb %al, %al
je 0x2aba
movq %r14, 0x48(%rsp)
leaq 0x56ca(%rip), %rdi      # 0x8106
callq 0x51af
movq %rax, 0x40(%rsp)
leaq 0x56c7(%rip), %rdi      # 0x8114
callq 0x51af
movq %rax, 0x38(%rsp)
leaq 0x10(%rsp), %rdi
xorl %esi, %esi
xorl %eax, %eax
callq 0x2420
movl %eax, %r14d
testl %eax, %eax
jns 0x2a7f
leaq 0x564a(%rip), %rdi      # 0x80bd
leaq 0x10(%rsp), %rsi
xorl %eax, %eax
callq 0x2fc5
pushq $0x2
popq %rdx
movl %r14d, %edi
xorl %esi, %esi
callq 0x2220
movq %rax, %r15
movl %r14d, %edi
xorl %esi, %esi
xorl %edx, %edx
callq 0x2220
leaq 0xc(%rsp), %rdx
movl $0x1268, %esi           # imm = 0x1268
movl %r14d, %edi
xorl %eax, %eax
callq 0x2250
testl %eax, %eax
js 0x2b25
movslq 0xc(%rsp), %rcx
jmp 0x2b32
leaq 0x10(%rsp), %rdi
xorl %esi, %esi
xorl %eax, %eax
callq 0x2420
movl %eax, %ebp
testl %eax, %eax
jns 0x2ae1
leaq 0x55e8(%rip), %rdi      # 0x80bd
leaq 0x10(%rsp), %rsi
xorl %eax, %eax
callq 0x2fc5
movl %ebp, %edi
callq 0x2280
leaq 0x565d(%rip), %rsi      # 0x814c
leaq 0x10(%rsp), %rdi
pushq $0x1
popq %rcx
movq %r14, %rdx
xorl %r8d, %r8d
callq 0x21a0
testl %eax, %eax
jns 0x2d9d
leaq 0x571f(%rip), %rdi      # 0x8230
leaq 0x10(%rsp), %rdx
movq %r14, %rsi
xorl %eax, %eax
callq 0x2fc5
jmp 0x2d9d
movl $0x200, 0xc(%rsp)       # imm = 0x200
movl $0x200, %ecx            # imm = 0x200
movq %r15, %rax
cqto
idivq %rcx
movq %rax, 0x30(%rsp)
leaq 0x5708(%rip), %rdi      # 0x824e
xorl %esi, %esi
xorl %eax, %eax
callq 0x2420
movl %eax, %ebp
testl %eax, %eax
jns 0x2b63
leaq 0x56fd(%rip), %rdi      # 0x8259
xorl %eax, %eax
callq 0x2fc5
movl $0x4c00, %esi           # imm = 0x4C00
movl %ebp, %edi
movl %r14d, %edx
xorl %eax, %eax
callq 0x2250
testl %eax, %eax
jns 0x2b86
leaq 0x56ff(%rip), %rdi      # 0x827e
xorl %eax, %eax
callq 0x2fc5
movl %r14d, %edi
callq 0x2280
leaq 0x56fc(%rip), %rdi      # 0x8291
pushq $0x2
popq %rsi
xorl %eax, %eax
callq 0x2420
movl %eax, %r13d
testl %eax, %eax
jns 0x2bb4
leaq 0x56f8(%rip), %rdi      # 0x82a5
xorl %eax, %eax
callq 0x2fc5
movl $0xc138fd03, %r12d      # imm = 0xC138FD03
leaq 0x70(%rsp), %r14
movl $0x3fe0, %edx           # imm = 0x3FE0
movq %r14, %rdi
xorl %esi, %esi
callq 0x2240
movaps 0x543b(%rip), %xmm0     # 0x8010
movaps %xmm0, -0x20(%r14)
movl $0x138, -0x10(%r14)     # imm = 0x138
xorps %xmm0, %xmm0
movups %xmm0, -0xc(%r14)
movl $0x736674, %eax         # imm = 0x736674
movl %eax, 0x13(%r14)
movl $0x746f6f72, 0x10(%r14) # imm = 0x746F6F72
movl %eax, 0x9f(%r14)
movups 0x56d7(%rip), %xmm0     # 0x82e0
movaps %xmm0, 0x90(%r14)
leaq 0x50(%rsp), %rdx
movl $0xc138fd03, %esi       # imm = 0xC138FD03
movl %r13d, %edi
xorl %eax, %eax
callq 0x2250
testl %eax, %eax
jns 0x2c37
leaq 0x56c3(%rip), %rdi      # 0x82f3
xorl %eax, %eax
callq 0x2fc5
leaq 0x60(%rsp), %r15
movl $0x3fe0, %edx           # imm = 0x3FE0
movq %r14, %rdi
xorl %esi, %esi
callq 0x2240
movaps 0x53be(%rip), %xmm0     # 0x8010
movaps %xmm0, -0x10(%r15)
movaps 0x53c2(%rip), %xmm0     # 0x8020
movaps %xmm0, (%r15)
movl $0x746f6f72, 0x10(%r14) # imm = 0x746F6F72
movl $0x736674, 0x13(%r14)   # imm = 0x736674
xorps %xmm0, %xmm0
movups %xmm0, 0x128(%r15)
movups %xmm0, 0x138(%r15)
andq $0x0, 0x148(%r15)
movq 0x30(%rsp), %rax
movq %rax, 0x130(%r15)
movl $0x70797263, 0x140(%r15) # imm = 0x70797263
movw $0x74, 0x144(%r15)
leaq 0x1b0(%rsp), %rdi
leaq 0x565d(%rip), %rsi      # 0x831a
movq 0x40(%rsp), %rdx
movq 0x38(%rsp), %rcx
xorl %eax, %eax
callq 0x2490
leaq 0x6(%r12), %rsi
leaq 0x50(%rsp), %rdx
movl %r13d, %edi
xorl %eax, %eax
callq 0x2250
testl %eax, %eax
jns 0x2cf4
leaq 0x5642(%rip), %rdi      # 0x832f
xorl %eax, %eax
callq 0x2fc5
movl $0x3ff0, %edx           # imm = 0x3FF0
movq %r15, %rdi
xorl %esi, %esi
callq 0x2240
leaq 0x50(%rsp), %rdx
movaps 0x5301(%rip), %xmm0     # 0x8010
movaps %xmm0, (%rdx)
movl $0x138, 0x10(%rdx)      # imm = 0x138
movl $0x8000, 0x1c(%rdx)     # imm = 0x8000
movl $0x746f6f72, 0x10(%r14) # imm = 0x746F6F72
movl $0x736674, 0x13(%r14)   # imm = 0x736674
addq $0x3, %r12
movl %r13d, %edi
movq %r12, %rsi
xorl %eax, %eax
callq 0x2250
testl %eax, %eax
jns 0x2d53
leaq 0x5611(%rip), %rdi      # 0x835d
xorl %eax, %eax
callq 0x2fc5
movl %r13d, %edi
callq 0x2280
leaq 0x54c4(%rip), %rdi      # 0x8226
leaq 0x53e3(%rip), %rsi      # 0x814c
pushq $0x1
popq %rcx
movq 0x48(%rsp), %r14
movq %r14, %rdx
xorl %r8d, %r8d
callq 0x21a0
testl %eax, %eax
jns 0x2d96
leaq 0x54a9(%rip), %rdi      # 0x8230
leaq 0x10(%rsp), %rdx
movq %r14, %rsi
xorl %eax, %eax
callq 0x2fc5
movl %ebp, %edi
callq 0x2280
leaq 0x10(%rsp), %rdi
callq 0x78f0
leaq 0x53c9(%rip), %rdi      # 0x8177
leaq 0x55be(%rip), %rsi      # 0x8373
movl $0x2000, %ecx           # imm = 0x2000
xorl %edx, %edx
xorl %r8d, %r8d
callq 0x21a0
testl %eax, %eax
jns 0x2dd6
leaq 0x55ad(%rip), %rdi      # 0x837c
xorl %eax, %eax
callq 0x2ee4
leaq 0x53b1(%rip), %rdi      # 0x818e
callq 0x2130
testl %eax, %eax
jns 0x2df4
leaq 0x55a2(%rip), %rdi      # 0x838f
xorl %eax, %eax
callq 0x2ee4
leaq 0x53a4(%rip), %rdi      # 0x819f
callq 0x2130
testl %eax, %eax
jns 0x2e12
leaq 0x559b(%rip), %rdi      # 0x83a6
xorl %eax, %eax
callq 0x2ee4
leaq 0x55a5(%rip), %rdi      # 0x83be
xorl %esi, %esi
xorl %eax, %eax
callq 0x2420
testl %eax, %eax
js 0x2e4e
leaq 0xa4a3(%rip), %rsi      # 0xd2d0
movl %eax, %edi
callq 0x263c
leaq 0x5353(%rip), %rdi      # 0x818e
callq 0x2180
leaq 0x5358(%rip), %rdi      # 0x819f
callq 0x2180
jmp 0x2e5c
leaq 0x557b(%rip), %rdi      # 0x83d0
xorl %eax, %eax
callq 0x2ee4
leaq 0x52e9(%rip), %rdi      # 0x814c
callq 0x21c0
leaq 0x52db(%rip), %rdi      # 0x814a
leaq 0x5548(%rip), %rsi      # 0x83be
movl $0x2000, %ecx           # imm = 0x2000
xorl %edx, %edx
xorl %r8d, %r8d
callq 0x21a0
testl %eax, %eax
jns 0x2e97
leaq 0x5530(%rip), %rdi      # 0x83c0
xorl %eax, %eax
callq 0x2ee4
leaq 0x52ac(%rip), %rdi      # 0x814a
callq 0x20b0
leaq 0x5278(%rip), %rdi      # 0x8122
movq %rbx, %rsi
callq 0x2500
callq 0x2070
movl (%rax), %edi
callq 0x24e0
leaq 0x5268(%rip), %rdi      # 0x812d
movq %rax, %rsi
xorl %eax, %eax
callq 0x2fc5
xorl %eax, %eax
addq $0x4058, %rsp           # imm = 0x4058
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop