// File: /workspace/github_c_makefile_star2_O2/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 0x47c0
movq %rax, %rbx
leaq 0x1d465(%rip), %rax     # 0x28f18
movq (%rax), %rsi
movq %rbx, %rdi
xorl %edx, %edx
xorl %eax, %eax
callq 0xbd17
leaq 0x1d48f(%rip), %r15     # 0x28f58
cmpl $0x0, (%r15)
jne 0xbaee
leaq 0x1d46a(%rip), %rax     # 0x28f40
cmpl $0x0, (%rax)
je 0xbaee
leaq 0x4f2a(%rip), %rsi      # 0x10a0c
movq %rbx, %rdi
xorl %edx, %edx
xorl %eax, %eax
callq 0xbd17
leaq 0x1d47b(%rip), %r12     # 0x28f70
movq (%r12), %rax
testq %rax, %rax
je 0xbb20
xorl %r13d, %r13d
movq (%rax,%r13), %rsi
testq %rsi, %rsi
je 0xbb20
movq %rbx, %rdi
xorl %edx, %edx
xorl %eax, %eax
callq 0xbd17
movq (%r12), %rax
addq $0x8, %r13
jmp 0xbb01
cmpl $0x0, (%r15)
je 0xbb65
leaq 0x1d403(%rip), %rax     # 0x28f30
movq (%rax), %rcx
leaq 0x1d419(%rip), %rax     # 0x28f50
movq (%rax), %r9
andq $0x0, 0x8(%rsp)
leaq 0x4eeb(%rip), %rax      # 0x10a32
movq %rax, (%rsp)
leaq 0x2ea7(%rip), %rsi      # 0xe9f9
leaq 0x4ec4(%rip), %rdx      # 0x10a1d
leaq 0x4ec8(%rip), %r8       # 0x10a28
jmp 0xbc18
leaq 0x1d3f4(%rip), %r15     # 0x28f60
cmpq $0x0, (%r15)
leaq 0x19a2(%rip), %rax      # 0xd519
leaq 0x2909(%rip), %rsi      # 0xe487
cmoveq %rax, %rsi
leaq 0x1d397(%rip), %r12     # 0x28f20
movq (%r12), %rcx
leaq 0x1d39c(%rip), %rax     # 0x28f30
movq (%rax), %r9
andq $0x0, (%rsp)
leaq 0x4e98(%rip), %rdx      # 0x10a3b
leaq 0x4e73(%rip), %r8       # 0x10a1d
movq %rbx, %rdi
xorl %eax, %eax
callq 0xbd17
leaq 0x1d389(%rip), %rax     # 0x28f44
cmpl $0x0, (%rax)
je 0xbbd3
leaq 0x4e7d(%rip), %rsi      # 0x10a44
movq %rbx, %rdi
xorl %edx, %edx
xorl %eax, %eax
callq 0xbd17
leaq 0x1d3b2(%rip), %rax     # 0x28f8c
cmpl $0x0, (%rax)
je 0xbbf2
leaq 0x4e69(%rip), %rsi      # 0x10a4f
movq %rbx, %rdi
xorl %edx, %edx
xorl %eax, %eax
callq 0xbd17
movq (%r15), %rcx
testq %rcx, %rcx
je 0xbc22
movq (%r12), %r9
andq $0x0, (%rsp)
leaq 0x4e28(%rip), %rsi      # 0x10a32
leaq 0x4e4f(%rip), %rdx      # 0x10a60
leaq 0x4e55(%rip), %r8       # 0x10a6d
movq %rbx, %rdi
xorl %eax, %eax
callq 0xbd17
leaq 0x1d33f(%rip), %r15     # 0x28f68
movq (%r15), %rax
testq %rax, %rax
je 0xbc52
xorl %r12d, %r12d
movq (%rax,%r12), %rsi
testq %rsi, %rsi
je 0xbc52
movq %rbx, %rdi
xorl %edx, %edx
xorl %eax, %eax
callq 0xbd17
movq (%r15), %rax
addq $0x8, %r12
jmp 0xbc34
testq %r14, %r14
je 0xbc6d
leaq 0x4e1b(%rip), %rsi      # 0x10a79
movq %rbx, %rdi
movq %r14, %rdx
xorl %ecx, %ecx
xorl %eax, %eax
callq 0xbd17
leaq 0x1d28c(%rip), %rax     # 0x28f00
movq (%rax), %rsi
movq %rbx, %rdi
xorl %edx, %edx
xorl %eax, %eax
callq 0xbd17
movq %rbx, %rdi
xorl %esi, %esi
callq 0x4350
leaq 0x8810(%rip), %r15      # 0x144a4
cmpl $0x4, (%r15)
jne 0xbcbf
movl $0x2000, %edi           # imm = 0x2000
callq 0x4330
movq %rax, %r14
leaq 0x12a(%rip), %rsi       # 0xbdd8
movq %rbx, %rdi
movq %rax, %rdx
callq 0x42b0
cmpl $0x4, (%r15)
jae 0xbcd0
movq %rbx, %rax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq 0x8319(%rip), %rax      # 0x13ff0
movq (%rax), %rdi
movq (%r14), %rdx
leaq 0x4da6(%rip), %rsi      # 0x10a8a
xorl %eax, %eax
callq 0x4830
leaq 0x1d1e6(%rip), %rax     # 0x28ed8
cmpl $0x0, (%rax)
je 0xbcbf
leaq 0x1d1d2(%rip), %rax     # 0x28ed0
movq (%rax), %rdx
movq (%r14), %rcx
leaq 0x4da5(%rip), %rsi      # 0x10ab0
pushq $0x6
popq %rdi
xorl %eax, %eax
callq 0x4120
jmp 0xbcbf