// File: /workspace/github_c_makefile_star2_O0/atomlang[P]atomlang/src/pk_core.c
// Function: pkGetArgString
bool pkGetArgString(PKVM* vm, int arg, const char** value, uint32_t* length) {
  CHECK_GET_ARG_API_ERRORS();

  Var val = ARG(arg);
  if (IS_OBJ_TYPE(val, OBJ_STRING)) {
    String* str = (String*)AS_OBJ(val);
    *value = str->data;
    if (length) *length = str->length;

  } else {
    ERR_INVALID_ARG_TYPE("string");
    return false;
  }

  return true;
}

// Assembly:
subq $0x48, %rsp
movq %rdi, 0x38(%rsp)
movl %esi, 0x34(%rsp)
movq %rdx, 0x28(%rsp)
movq %rcx, 0x20(%rsp)
jmp 0x1b8e9
movq 0x38(%rsp), %rax
cmpq $0x0, 0x5f0(%rax)
jne 0x1b932
movq 0x176f9(%rip), %rax     # 0x32ff8
movq (%rax), %rdi
leaq 0xe847(%rip), %rsi      # 0x2a150
leaq 0xedac(%rip), %rdx      # 0x2a6bc
leaq 0x102d3(%rip), %rcx     # 0x2bbea
leaq 0x10178(%rip), %r8      # 0x2ba96
movl $0xcc, %r9d
movb $0x0, %al
callq 0x2240
ud2
callq 0x2040
jmp 0x1b934
cmpl $0x0, 0x34(%rsp)
je 0x1b9b4
jmp 0x1b93d
cmpl $0x0, 0x34(%rsp)
jle 0x1b976
movl 0x34(%rsp), %eax
movq 0x38(%rsp), %rcx
movq 0x5f0(%rcx), %rcx
movq 0x30(%rcx), %rcx
movq 0x38(%rsp), %rdx
movq 0x5f0(%rdx), %rdx
movq 0x38(%rdx), %rdx
subq %rdx, %rcx
sarq $0x3, %rcx
subl $0x1, %ecx
cmpl %ecx, %eax
jle 0x1b9b0
movq 0x1767b(%rip), %rax     # 0x32ff8
movq (%rax), %rdi
leaq 0xe7c9(%rip), %rsi      # 0x2a150
leaq 0x101d8(%rip), %rdx     # 0x2bb66
leaq 0x10255(%rip), %rcx     # 0x2bbea
leaq 0x100fa(%rip), %r8      # 0x2ba96
movl $0xcc, %r9d
movb $0x0, %al
callq 0x2240
ud2
callq 0x2040
jmp 0x1b9b2
jmp 0x1b9b4
jmp 0x1b9b6
cmpq $0x0, 0x28(%rsp)
jne 0x1b9f8
movq 0x17633(%rip), %rax     # 0x32ff8
movq (%rax), %rdi
leaq 0xe781(%rip), %rsi      # 0x2a150
leaq 0x101b5(%rip), %rdx     # 0x2bb8b
leaq 0x1020d(%rip), %rcx     # 0x2bbea
leaq 0x100b2(%rip), %r8      # 0x2ba96
movl $0xcc, %r9d
movb $0x0, %al
callq 0x2240
ud2
callq 0x2040
jmp 0x1b9fa
jmp 0x1b9fc
movq 0x38(%rsp), %rax
movq 0x5f0(%rax), %rax
movq 0x38(%rax), %rax
movslq 0x34(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, 0x18(%rsp)
movabsq $-0x4000000000000, %rax # imm = 0xFFFC000000000000
andq 0x18(%rsp), %rax
movabsq $-0x4000000000000, %rcx # imm = 0xFFFC000000000000
cmpq %rcx, %rax
jne 0x1ba8d
movabsq $0xffffffffffff, %rax   # imm = 0xFFFFFFFFFFFF
andq 0x18(%rsp), %rax
cmpl $0x0, (%rax)
jne 0x1ba8d
movabsq $0xffffffffffff, %rax   # imm = 0xFFFFFFFFFFFF
andq 0x18(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x10(%rsp), %rcx
addq $0x1c, %rcx
movq 0x28(%rsp), %rax
movq %rcx, (%rax)
cmpq $0x0, 0x20(%rsp)
je 0x1ba88
movq 0x10(%rsp), %rax
movl 0x14(%rax), %ecx
movq 0x20(%rsp), %rax
movl %ecx, (%rax)
jmp 0x1bbc4
jmp 0x1ba8f
cmpl $0x0, 0x34(%rsp)
je 0x1bb39
leaq 0x4(%rsp), %rdi
movl 0x34(%rsp), %edx
leaq 0x120c7(%rip), %rsi     # 0x2db71
movb $0x0, %al
callq 0x2350
jmp 0x1bab3
movq 0x38(%rsp), %rax
movq 0x5f0(%rax), %rax
cmpq $0x0, 0x58(%rax)
je 0x1bb00
movq 0x1752b(%rip), %rax     # 0x32ff8
movq (%rax), %rdi
leaq 0xe679(%rip), %rsi      # 0x2a150
leaq 0xe786(%rip), %rdx      # 0x2a264
leaq 0x10105(%rip), %rcx     # 0x2bbea
leaq 0xffaa(%rip), %r8       # 0x2ba96
movl $0xd5, %r9d
movb $0x0, %al
callq 0x2240
ud2
callq 0x2040
jmp 0x1bb02
movq 0x38(%rsp), %rdi
leaq 0x4(%rsp), %rcx
leaq 0x100a2(%rip), %rsi     # 0x2bbb5
leaq 0x101e2(%rip), %rdx     # 0x2bcfc
movb $0x0, %al
callq 0x4ed0
movq %rax, %rcx
movq 0x38(%rsp), %rax
movq 0x5f0(%rax), %rax
movq %rcx, 0x58(%rax)
jmp 0x1bbbb
jmp 0x1bb3b
jmp 0x1bb3d
movq 0x38(%rsp), %rax
movq 0x5f0(%rax), %rax
cmpq $0x0, 0x58(%rax)
je 0x1bb8a
movq 0x174a1(%rip), %rax     # 0x32ff8
movq (%rax), %rdi
leaq 0xe5ef(%rip), %rsi      # 0x2a150
leaq 0xe6fc(%rip), %rdx      # 0x2a264
leaq 0x1007b(%rip), %rcx     # 0x2bbea
leaq 0xff20(%rip), %r8       # 0x2ba96
movl $0xd5, %r9d
movb $0x0, %al
callq 0x2240
ud2
callq 0x2040
jmp 0x1bb8c
movq 0x38(%rsp), %rdi
leaq 0x10042(%rip), %rsi     # 0x2bbda
leaq 0x1015d(%rip), %rdx     # 0x2bcfc
movb $0x0, %al
callq 0x4ed0
movq %rax, %rcx
movq 0x38(%rsp), %rax
movq 0x5f0(%rax), %rax
movq %rcx, 0x58(%rax)
jmp 0x1bbbb
jmp 0x1bbbd
movb $0x0, 0x47(%rsp)
jmp 0x1bbc9
movb $0x1, 0x47(%rsp)
movb 0x47(%rsp), %al
andb $0x1, %al
addq $0x48, %rsp
retq
nopw %cs:(%rax,%rax)