// File: /workspace/github_c_makefile_star2_O0/containers[P]conmon/src/ctr_logging.c
// Function: parse_log_path
static void parse_log_path(char *log_config)
{
	const char *delim = strchr(log_config, ':');
	char *driver = strtok(log_config, ":");
	char *path = strtok(NULL, ":");

	if (path == NULL && driver == NULL) {
		nexitf("log-path must not be empty");
	}

	// :none is not the same as none, nor is :journald the same as journald
	// we check the delim here though, because we DO want to match "none" as the none driver
	if (path == NULL && delim == log_config) {
		path = driver;
		driver = (char *)K8S_FILE_STRING;
	}

	if (!strcmp(driver, "off") || !strcmp(driver, "null") || !strcmp(driver, "none")) {
		// no-op, this means things like --log-driver journald --log-driver none will still log to journald.
		return;
	}

	if (!strcmp(driver, "passthrough")) {
		use_logging_passthrough = TRUE;
		return;
	}

	if (!strcmp(driver, JOURNALD_FILE_STRING)) {
		use_journald_logging = TRUE;
		return;
	}

	// Driver is k8s-file or empty
	if (!strcmp(driver, K8S_FILE_STRING)) {
		if (path == NULL) {
			nexitf("k8s-file requires a filename");
		}
		use_k8s_logging = TRUE;
		k8s_log_path = path;
		return;
	}

	// If no : was found, use the entire log-path as a filename to k8s-file.
	if (path == NULL && delim == NULL) {
		use_k8s_logging = TRUE;
		k8s_log_path = driver;
		return;
	}

	nexitf("No such log driver %s", driver);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movl $0x3a, %esi
callq 0x4560
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rdi
leaq 0x8a6a(%rip), %rsi      # 0xfe73
callq 0x4650
movq %rax, -0x18(%rbp)
xorl %eax, %eax
movl %eax, %edi
leaq 0x8a56(%rip), %rsi      # 0xfe73
callq 0x4650
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
jne 0x7481
cmpq $0x0, -0x18(%rbp)
jne 0x7481
jmp 0x7436
movq 0xebb3(%rip), %rax      # 0x15ff0
movq (%rax), %rdi
leaq 0x8a2e(%rip), %rsi      # 0xfe75
movb $0x0, %al
callq 0x4830
leaq 0x23af3(%rip), %rax     # 0x2af48
cmpl $0x0, (%rax)
je 0x7477
leaq 0x23adf(%rip), %rax     # 0x2af40
movq (%rax), %rdx
movl $0x3, %edi
leaq 0x8a2d(%rip), %rsi      # 0xfe9d
movb $0x0, %al
callq 0x4120
movl $0x1, %edi
callq 0x41e0
cmpq $0x0, -0x20(%rbp)
jne 0x74a5
movq -0x10(%rbp), %rax
cmpq -0x8(%rbp), %rax
jne 0x74a5
movq -0x18(%rbp), %rax
movq %rax, -0x20(%rbp)
leaq 0x8a2f(%rip), %rax      # 0xfed0
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rdi
leaq 0x8a29(%rip), %rsi      # 0xfed9
callq 0x4620
cmpl $0x0, %eax
je 0x74e4
movq -0x18(%rbp), %rdi
leaq 0x7ba9(%rip), %rsi      # 0xf06e
callq 0x4620
cmpl $0x0, %eax
je 0x74e4
movq -0x18(%rbp), %rdi
leaq 0x8a03(%rip), %rsi      # 0xfedd
callq 0x4620
cmpl $0x0, %eax
jne 0x74e9
jmp 0x762b
movq -0x18(%rbp), %rdi
leaq 0x89ee(%rip), %rsi      # 0xfee2
callq 0x4620
cmpl $0x0, %eax
jne 0x750d
movl $0x1, 0x1f978(%rip)     # 0x26e80
jmp 0x762b
movq -0x18(%rbp), %rdi
leaq 0x89d6(%rip), %rsi      # 0xfeee
callq 0x4620
cmpl $0x0, %eax
jne 0x7531
movl $0x1, 0x1f974(%rip)     # 0x26ea0
jmp 0x762b
movq -0x18(%rbp), %rdi
leaq 0x8994(%rip), %rsi      # 0xfed0
callq 0x4620
cmpl $0x0, %eax
jne 0x75b1
cmpq $0x0, -0x20(%rbp)
jne 0x759a
jmp 0x754f
movq 0xea9a(%rip), %rax      # 0x15ff0
movq (%rax), %rdi
leaq 0x8997(%rip), %rsi      # 0xfef7
movb $0x0, %al
callq 0x4830
leaq 0x239da(%rip), %rax     # 0x2af48
cmpl $0x0, (%rax)
je 0x7590
leaq 0x239c6(%rip), %rax     # 0x2af40
movq (%rax), %rdx
movl $0x3, %edi
leaq 0x8998(%rip), %rsi      # 0xff21
movb $0x0, %al
callq 0x4120
movl $0x1, %edi
callq 0x41e0
movl $0x1, 0x1f8e0(%rip)     # 0x26e84
movq -0x20(%rbp), %rax
movq %rax, 0x1f8d9(%rip)     # 0x26e88
jmp 0x762b
cmpq $0x0, -0x20(%rbp)
jne 0x75d6
cmpq $0x0, -0x10(%rbp)
jne 0x75d6
movl $0x1, 0x1f8bb(%rip)     # 0x26e84
movq -0x18(%rbp), %rax
movq %rax, 0x1f8b4(%rip)     # 0x26e88
jmp 0x762b
jmp 0x75d8
movq 0xea11(%rip), %rax      # 0x15ff0
movq (%rax), %rdi
movq -0x18(%rbp), %rdx
leaq 0x8969(%rip), %rsi      # 0xff56
movb $0x0, %al
callq 0x4830
leaq 0x2394d(%rip), %rax     # 0x2af48
cmpl $0x0, (%rax)
je 0x7621
leaq 0x23939(%rip), %rax     # 0x2af40
movq (%rax), %rdx
movq -0x18(%rbp), %rcx
movl $0x3, %edi
leaq 0x895f(%rip), %rsi      # 0xff79
movb $0x0, %al
callq 0x4120
movl $0x1, %edi
callq 0x41e0
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)