// File: /workspace/github_c_makefile_star2_O1/containers[P]conmon/src/runtime_args.c
// Function: configure_runtime_args
GPtrArray *configure_runtime_args(const char *const csname)
{
	GPtrArray *runtime_argv = g_ptr_array_new();
	add_argv(runtime_argv, opt_runtime_path, NULL);

	/* Generate the cmdline. */
	if (!opt_exec && opt_systemd_cgroup)
		add_argv(runtime_argv, "--systemd-cgroup", NULL);

	if (opt_runtime_args) {
		size_t n_runtime_args = 0;
		while (opt_runtime_args[n_runtime_args])
			add_argv(runtime_argv, opt_runtime_args[n_runtime_args++], NULL);
	}

	/* Set the exec arguments. */
	if (opt_exec) {
		add_argv(runtime_argv, "exec", "--pid-file", opt_container_pid_file, "--process", opt_exec_process_spec, "--detach", NULL);
	} else {
		char *command;
		if (opt_restore_path)
			command = "restore";
		else
			command = "create";

		add_argv(runtime_argv, command, "--bundle", opt_bundle_path, "--pid-file", opt_container_pid_file, NULL);
		if (opt_no_pivot)
			add_argv(runtime_argv, "--no-pivot", NULL);
		if (opt_no_new_keyring)
			add_argv(runtime_argv, "--no-new-keyring", NULL);

		if (opt_restore_path) {
			/*
			 * 'runc restore' is different from 'runc create'
			 * as the container is immediately running after
			 * a restore. Therefore the '--detach is needed'
			 * so that runc returns once the container is running.
			 *
			 * '--image-path' is the path to the checkpoint
			 * which will be become important when using pre-copy
			 * migration where multiple checkpoints can be created
			 * to reduce the container downtime during migration.
			 *
			 * '--work-path' is the directory CRIU will run in and
			 * also place its log files.
			 */
			add_argv(runtime_argv, "--detach", "--image-path", opt_restore_path, "--work-path", opt_bundle_path, NULL);
		}
	}
	/*
	 *  opt_runtime_opts can contain 'runc restore' or 'runc exec' options like
	 *  '--tcp-established' or '--preserve-fds'. Instead of listing each option as
	 *  a special conmon option, this (--runtime-opt) provides
	 *  a generic interface to pass all those options to conmon
	 *  without requiring a code change for each new option.
	 */
	if (opt_runtime_opts) {
		size_t n_runtime_opts = 0;
		while (opt_runtime_opts[n_runtime_opts])
			add_argv(runtime_argv, opt_runtime_opts[n_runtime_opts++], NULL);
	}


	if (csname != NULL) {
		add_argv(runtime_argv, "--console-socket", csname, NULL);
	}

	/* Container name comes last. */
	add_argv(runtime_argv, opt_cid, NULL);
	end_argv(runtime_argv);

	print_argv(runtime_argv);

	return runtime_argv;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdi, %r14
callq 0x47b0
movq %rax, %rbx
leaq 0x1d665(%rip), %rax     # 0x29f08
movq (%rax), %rsi
movq %rbx, %rdi
xorl %edx, %edx
xorl %eax, %eax
callq 0xcae8
leaq 0x1d68f(%rip), %r15     # 0x29f48
cmpl $0x0, (%r15)
jne 0xc8de
leaq 0x1d66a(%rip), %rax     # 0x29f30
cmpl $0x0, (%rax)
je 0xc8de
leaq 0x415a(%rip), %rsi      # 0x10a2c
movq %rbx, %rdi
xorl %edx, %edx
xorl %eax, %eax
callq 0xcae8
leaq 0x1d67b(%rip), %r12     # 0x29f60
cmpq $0x0, (%r12)
je 0xc91b
movq (%r12), %rax
movq (%rax), %rsi
testq %rsi, %rsi
je 0xc91b
movl $0x8, %r13d
movq %rbx, %rdi
xorl %edx, %edx
xorl %eax, %eax
callq 0xcae8
movq (%r12), %rax
movq (%rax,%r13), %rsi
addq $0x8, %r13
testq %rsi, %rsi
jne 0xc8fe
cmpl $0x0, (%r15)
je 0xc963
leaq 0x1d5f8(%rip), %rax     # 0x29f20
movq (%rax), %rcx
leaq 0x1d60e(%rip), %rax     # 0x29f40
movq (%rax), %r9
leaq 0x4116(%rip), %rax      # 0x10a52
movq %rax, (%rsp)
movq $0x0, 0x8(%rsp)
leaq 0x20c9(%rip), %rsi      # 0xea19
leaq 0x40e6(%rip), %rdx      # 0x10a3d
leaq 0x40ea(%rip), %r8       # 0x10a48
jmp 0xca1c
leaq 0x1d5e6(%rip), %r15     # 0x29f50
cmpq $0x0, (%r15)
leaq 0xba4(%rip), %rax       # 0xd519
leaq 0x1b2b(%rip), %rsi      # 0xe4a7
cmoveq %rax, %rsi
leaq 0x1d589(%rip), %r12     # 0x29f10
movq (%r12), %rcx
leaq 0x1d58e(%rip), %rax     # 0x29f20
movq (%rax), %r9
movq $0x0, (%rsp)
leaq 0x40b7(%rip), %rdx      # 0x10a5b
leaq 0x4092(%rip), %r8       # 0x10a3d
movq %rbx, %rdi
xorl %eax, %eax
callq 0xcae8
leaq 0x1d578(%rip), %rax     # 0x29f34
cmpl $0x0, (%rax)
je 0xc9d4
leaq 0x409c(%rip), %rsi      # 0x10a64
movq %rbx, %rdi
xorl %edx, %edx
xorl %eax, %eax
callq 0xcae8
leaq 0x1d5a1(%rip), %rax     # 0x29f7c
cmpl $0x0, (%rax)
je 0xc9f3
leaq 0x4088(%rip), %rsi      # 0x10a6f
movq %rbx, %rdi
xorl %edx, %edx
xorl %eax, %eax
callq 0xcae8
movq (%r15), %rcx
testq %rcx, %rcx
je 0xca26
movq (%r12), %r9
movq $0x0, (%rsp)
leaq 0x4044(%rip), %rsi      # 0x10a52
leaq 0x406b(%rip), %rdx      # 0x10a80
leaq 0x4071(%rip), %r8       # 0x10a8d
movq %rbx, %rdi
xorl %eax, %eax
callq 0xcae8
leaq 0x1d52b(%rip), %r15     # 0x29f58
cmpq $0x0, (%r15)
je 0xca60
movq (%r15), %rax
movq (%rax), %rsi
testq %rsi, %rsi
je 0xca60
movl $0x8, %r12d
movq %rbx, %rdi
xorl %edx, %edx
xorl %eax, %eax
callq 0xcae8
movq (%r15), %rax
movq (%rax,%r12), %rsi
addq $0x8, %r12
testq %rsi, %rsi
jne 0xca44
testq %r14, %r14
je 0xca7b
leaq 0x402d(%rip), %rsi      # 0x10a99
movq %rbx, %rdi
movq %r14, %rdx
xorl %ecx, %ecx
xorl %eax, %eax
callq 0xcae8
leaq 0x1d46e(%rip), %rax     # 0x29ef0
movq (%rax), %rsi
movq %rbx, %rdi
xorl %edx, %edx
xorl %eax, %eax
callq 0xcae8
movq %rbx, %rdi
xorl %esi, %esi
callq 0x4350
leaq 0x89f2(%rip), %r15      # 0x15494
cmpl $0x4, (%r15)
jne 0xcacd
movl $0x2000, %edi           # imm = 0x2000
callq 0x4330
movq %rax, %r14
leaq 0xed(%rip), %rsi        # 0xcba9
movq %rbx, %rdi
movq %rax, %rdx
callq 0x42b0
cmpl $0x4, (%r15)
jae 0xcade
movq %rbx, %rax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq %r14, %rdi
callq 0x7ee4
jmp 0xcacd