// File: /workspace/github_c_makefile_star2_O3/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 0x1d87d(%rip), %rax     # 0x29f08
movq (%rax), %rsi
movq %rbx, %rdi
xorl %edx, %edx
xorl %eax, %eax
callq 0xc8cd
leaq 0x1d8a7(%rip), %r15     # 0x29f48
cmpl $0x0, (%r15)
jne 0xc6c6
leaq 0x1d882(%rip), %rax     # 0x29f30
cmpl $0x0, (%rax)
je 0xc6c6
leaq 0x4352(%rip), %rsi      # 0x10a0c
movq %rbx, %rdi
xorl %edx, %edx
xorl %eax, %eax
callq 0xc8cd
leaq 0x1d893(%rip), %r12     # 0x29f60
movq (%r12), %rax
testq %rax, %rax
je 0xc701
movq (%rax), %rsi
testq %rsi, %rsi
je 0xc701
movl $0x8, %r13d
movq %rbx, %rdi
xorl %edx, %edx
xorl %eax, %eax
callq 0xc8cd
movq (%r12), %rax
movq (%rax,%r13), %rsi
addq $0x8, %r13
testq %rsi, %rsi
jne 0xc6e4
cmpl $0x0, (%r15)
je 0xc749
leaq 0x1d812(%rip), %rax     # 0x29f20
movq (%rax), %rcx
leaq 0x1d828(%rip), %rax     # 0x29f40
movq (%rax), %r9
leaq 0x4310(%rip), %rax      # 0x10a32
movq %rax, (%rsp)
movq $0x0, 0x8(%rsp)
leaq 0x22c3(%rip), %rsi      # 0xe9f9
leaq 0x42e0(%rip), %rdx      # 0x10a1d
leaq 0x42e4(%rip), %r8       # 0x10a28
jmp 0xc802
leaq 0x1d800(%rip), %r15     # 0x29f50
cmpq $0x0, (%r15)
leaq 0xdbe(%rip), %rax       # 0xd519
leaq 0x1d25(%rip), %rsi      # 0xe487
cmoveq %rax, %rsi
leaq 0x1d7a3(%rip), %r12     # 0x29f10
movq (%r12), %rcx
leaq 0x1d7a8(%rip), %rax     # 0x29f20
movq (%rax), %r9
movq $0x0, (%rsp)
leaq 0x42b1(%rip), %rdx      # 0x10a3b
leaq 0x428c(%rip), %r8       # 0x10a1d
movq %rbx, %rdi
xorl %eax, %eax
callq 0xc8cd
leaq 0x1d792(%rip), %rax     # 0x29f34
cmpl $0x0, (%rax)
je 0xc7ba
leaq 0x4296(%rip), %rsi      # 0x10a44
movq %rbx, %rdi
xorl %edx, %edx
xorl %eax, %eax
callq 0xc8cd
leaq 0x1d7bb(%rip), %rax     # 0x29f7c
cmpl $0x0, (%rax)
je 0xc7d9
leaq 0x4282(%rip), %rsi      # 0x10a4f
movq %rbx, %rdi
xorl %edx, %edx
xorl %eax, %eax
callq 0xc8cd
movq (%r15), %rcx
testq %rcx, %rcx
je 0xc80c
movq (%r12), %r9
movq $0x0, (%rsp)
leaq 0x423e(%rip), %rsi      # 0x10a32
leaq 0x4265(%rip), %rdx      # 0x10a60
leaq 0x426b(%rip), %r8       # 0x10a6d
movq %rbx, %rdi
xorl %eax, %eax
callq 0xc8cd
leaq 0x1d745(%rip), %r15     # 0x29f58
movq (%r15), %rax
testq %rax, %rax
je 0xc845
movq (%rax), %rsi
testq %rsi, %rsi
je 0xc845
movl $0x8, %r12d
movq %rbx, %rdi
xorl %edx, %edx
xorl %eax, %eax
callq 0xc8cd
movq (%r15), %rax
movq (%rax,%r12), %rsi
addq $0x8, %r12
testq %rsi, %rsi
jne 0xc829
testq %r14, %r14
je 0xc860
leaq 0x4228(%rip), %rsi      # 0x10a79
movq %rbx, %rdi
movq %r14, %rdx
xorl %ecx, %ecx
xorl %eax, %eax
callq 0xc8cd
leaq 0x1d689(%rip), %rax     # 0x29ef0
movq (%rax), %rsi
movq %rbx, %rdi
xorl %edx, %edx
xorl %eax, %eax
callq 0xc8cd
movq %rbx, %rdi
xorl %esi, %esi
callq 0x4350
leaq 0x8c0d(%rip), %r15      # 0x15494
cmpl $0x4, (%r15)
jne 0xc8b2
movl $0x2000, %edi           # imm = 0x2000
callq 0x4330
movq %rax, %r14
leaq 0xed(%rip), %rsi        # 0xc98e
movq %rbx, %rdi
movq %rax, %rdx
callq 0x42b0
cmpl $0x4, (%r15)
jae 0xc8c3
movq %rbx, %rax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq %r14, %rdi
callq 0x7e8e
jmp 0xc8b2