// File: /workspace/github_c_makefile_star2_O3/containers[P]conmon/src/cli.c
// Function: process_cli
void process_cli()
{
	/* Command line parameters */
	set_conmon_logs(opt_log_level, opt_cid, opt_syslog, opt_log_tag);


	main_loop = g_main_loop_new(NULL, FALSE);

	if (opt_restore_path && opt_exec)
		nexit("Cannot use 'exec' and 'restore' at the same time");

	if (!opt_exec && opt_attach)
		nexit("Attach can only be specified with exec");

	if (opt_api_version < 1 && opt_attach)
		nexit("Attach can only be specified for a non-legacy exec session");

	/* The old exec API did not require opt_cuuid */
	if (opt_cuuid == NULL && (!opt_exec || opt_api_version >= 1))
		nexit("Container UUID not provided. Use --cuuid");

	if (opt_seccomp_notify_plugins == NULL)
		opt_seccomp_notify_plugins = getenv("CONMON_SECCOMP_NOTIFY_PLUGINS");

	if (opt_runtime_path == NULL)
		nexit("Runtime path not provided. Use --runtime");
	if (access(opt_runtime_path, X_OK) < 0)
		pexitf("Runtime path %s is not valid", opt_runtime_path);

	if (opt_exec && opt_exec_process_spec == NULL) {
		nexit("Exec process spec path not provided. Use --exec-process-spec");
	}

	char cwd[PATH_MAX];
	if (getcwd(cwd, sizeof(cwd)) == NULL) {
		nexit("Failed to get working directory");
	}

	// opt_bundle_path in exec means we will set up the attach socket
	// for the exec session. the legacy version of exec does not need this
	// and thus we only override an empty opt_bundle_path when we're not exec
	if (opt_bundle_path == NULL && !opt_exec) {
		opt_bundle_path = cwd;
	}

	if (opt_exit_delay < 0) {
		nexit("Delay before invoking exit command must be greater than or equal to 0");
	}

	// we should always override the container pid file if it's empty
	// TODO FIXME I removed default_pid_file here. shouldn't opt_container_pid_file be cleaned up?
	if (opt_container_pid_file == NULL)
		opt_container_pid_file = g_strdup_printf("%s/pidfile-%s", cwd, opt_cid);

	configure_log_drivers(opt_log_path, opt_log_size_max, opt_log_global_size_max, opt_cid, opt_name, opt_log_tag, opt_log_labels);
}

// Assembly:
pushq %rbx
subq $0x1010, %rsp           # imm = 0x1010
movq 0x20178(%rip), %rdi     # 0x29f98
movq 0x200c9(%rip), %rsi     # 0x29ef0
movl 0x200b3(%rip), %edx     # 0x29ee0
movq 0x2016c(%rip), %rcx     # 0x29fa0
callq 0x9a84
xorl %edi, %edi
xorl %esi, %esi
callq 0x4340
leaq 0x20197(%rip), %rcx     # 0x29fe0
movq %rax, (%rcx)
cmpq $0x0, 0x200fc(%rip)     # 0x29f50
setne %cl
movl 0x200eb(%rip), %eax     # 0x29f48
testl %eax, %eax
setne %dl
andb %cl, %dl
cmpb $0x1, %dl
je 0x9fcb
testl %eax, %eax
sete %dl
movl 0x200c0(%rip), %ecx     # 0x29f38
testl %ecx, %ecx
setne %sil
andb %dl, %sil
cmpb $0x1, %sil
je 0x9fd0
testl %ecx, %ecx
setne %dl
movl 0x200b6(%rip), %ecx     # 0x29f4c
testl %ecx, %ecx
setle %sil
andb %dl, %sil
cmpb $0x1, %sil
je 0x9fd5
testl %eax, %eax
setne %al
testl %ecx, %ecx
setle %cl
testb %cl, %al
jne 0x9ec5
cmpq $0x0, 0x20039(%rip)     # 0x29ef8
je 0x9fda
cmpq $0x0, 0x20103(%rip)     # 0x29fd0
jne 0x9ee2
leaq 0x4b8c(%rip), %rdi      # 0xea62
callq 0x4590
movq %rax, 0x200ee(%rip)     # 0x29fd0
movq 0x2001f(%rip), %rdi     # 0x29f08
testq %rdi, %rdi
je 0x9fdf
movl $0x1, %esi
callq 0x4750
testl %eax, %eax
js 0x9fe4
cmpl $0x0, 0x2003d(%rip)     # 0x29f48
je 0x9f1b
cmpq $0x0, 0x2002b(%rip)     # 0x29f40
je 0x9fe9
leaq 0x10(%rsp), %rbx
movl $0x1000, %esi           # imm = 0x1000
movq %rbx, %rdi
callq 0x4620
testq %rax, %rax
je 0x9fee
cmpq $0x0, 0x1ffd2(%rip)     # 0x29f10
jne 0x9f50
cmpl $0x0, 0x20001(%rip)     # 0x29f48
jne 0x9f50
movq %rbx, 0x1ffc0(%rip)     # 0x29f10
cmpl $0x0, 0x20039(%rip)     # 0x29f90
js 0x9ff3
cmpq $0x0, 0x1ffbb(%rip)     # 0x29f20
jne 0x9f88
movq 0x1ff82(%rip), %rdx     # 0x29ef0
leaq 0x4c3c(%rip), %rdi      # 0xebb1
leaq 0x10(%rsp), %rsi
xorl %eax, %eax
callq 0x4380
movq %rax, 0x1ff98(%rip)     # 0x29f20
movq 0x1ffd9(%rip), %rdi     # 0x29f68
movq 0xb50a(%rip), %rsi      # 0x154a0
movq 0xb50b(%rip), %rdx      # 0x154a8
movq 0x1ff4c(%rip), %rcx     # 0x29ef0
movq 0x1ff55(%rip), %r8      # 0x29f00
movq 0x1ffee(%rip), %r9      # 0x29fa0
movq 0x1ffef(%rip), %rax     # 0x29fa8
movq %rax, (%rsp)
callq 0x91ac
addq $0x1010, %rsp           # imm = 0x1010
popq %rbx
retq
callq 0x618c
callq 0x6136
callq 0x60e0
callq 0x608a
callq 0x6034
callq 0x5fde
callq 0x5f88
callq 0x5f32
callq 0x5edc