// File: /workspace/github_c_makefile_star2_O0/hcmiya[P]opuscomment/src/main.c
// Function: main
int main(int argc, char **argv) {
	struct sigaction sa;
	sa.sa_handler = interrupted;
	sigemptyset(&sa.sa_mask);
	sigaddset(&sa.sa_mask, SIGINT);
	sigaddset(&sa.sa_mask, SIGQUIT);
	sigaddset(&sa.sa_mask, SIGTERM);
	sigaddset(&sa.sa_mask, SIGPIPE);
	sa.sa_flags = 0;
	sigaction(SIGINT, &sa, NULL);
	sigaction(SIGQUIT, &sa, NULL);
	sigaction(SIGTERM, &sa, NULL);
	
	setlocale(LC_ALL, "");
	if (*argv[0]) {
		char *p = strrchr(argv[0], '/');
		program_name = p ? p + 1 : argv[0];
	}
	else {
		program_name = program_name_default;
	}
	select_codec();
	default_codec = codec;
	
#ifdef NLS
#define co catd = catopen("opuscomment", NL_CAT_LOCALE)
#ifdef DEFAULT_NLS_PATH
	char const *nlspath = getenv("NLSPATH");
	if (nlspath && *nlspath) {
		co;
	}
	else {
		setenv("NLSPATH", DEFAULT_NLS_PATH, true);
		co;
		if (catd == (nl_catd)-1) {
			unsetenv("NLSPATH");
			co;
		}
	}
#else
	co;
#endif
#undef co
#endif
	if (argc == 1) usage();
	
	parse_args(argc, argv);
	if (!argv[optind]) {
		mainerror(err_main_no_file);
	}
	if (argv[optind + 1]) {
		if (O.edit == EDIT_LIST) {
			mainerror(err_main_many_args);
		}
		if (argv[optind + 2]) {
			mainerror(err_main_many_args);
		}
		O.out = argv[optind + 1];
	}
	
	O.in = argv[optind];
	if (strcmp(O.in, "-")) {
		stream_input = fopen(O.in, "r");
		if (!stream_input) {
			fileerror(O.in);
		}
		struct stat sb;
		fstat(fileno(stream_input), &sb);
		input_is_regular_file = S_ISREG(sb.st_mode);
	}
	else {
		stream_input = stdin;
	}
	
	open_output_file();
	if (codec->type == CODEC_FLAC) read_flac();
	else read_ogg();
	
	if (opst < PAGE_SOUND) {
		opuserror(err_opus_interrupted);
	}
	
	move_file();
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x150, %rsp            # imm = 0x150
movl $0x0, -0x4(%rbp)
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
leaq 0x300(%rip), %rax       # 0x8e10
movq %rax, -0xa8(%rbp)
leaq -0xa8(%rbp), %rdi
addq $0x8, %rdi
callq 0x22a0
leaq -0xa8(%rbp), %rdi
addq $0x8, %rdi
movl $0x2, %esi
callq 0x2500
leaq -0xa8(%rbp), %rdi
addq $0x8, %rdi
movl $0x3, %esi
callq 0x2500
leaq -0xa8(%rbp), %rdi
addq $0x8, %rdi
movl $0xf, %esi
callq 0x2500
leaq -0xa8(%rbp), %rdi
addq $0x8, %rdi
movl $0xd, %esi
callq 0x2500
movl $0x0, -0x20(%rbp)
movl $0x2, %edi
leaq -0xa8(%rbp), %rsi
xorl %eax, %eax
movl %eax, %edx
callq 0x20d0
movl $0x3, %edi
leaq -0xa8(%rbp), %rsi
xorl %eax, %eax
movl %eax, %edx
callq 0x20d0
movl $0xf, %edi
leaq -0xa8(%rbp), %rsi
xorl %eax, %eax
movl %eax, %edx
callq 0x20d0
movl $0x6, %edi
leaq 0x1b65(%rip), %rsi      # 0xa732
callq 0x2370
movq -0x10(%rbp), %rax
movq (%rax), %rax
cmpb $0x0, (%rax)
je 0x8c32
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movl $0x2f, %esi
callq 0x2180
movq %rax, -0xb0(%rbp)
cmpq $0x0, -0xb0(%rbp)
je 0x8c14
movq -0xb0(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x148(%rbp)
jmp 0x8c22
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x148(%rbp)
movq -0x148(%rbp), %rax
movq %rax, 0x14a78(%rip)     # 0x1d6a8
jmp 0x8c40
leaq 0x1a33(%rip), %rax      # 0xa66c
movq %rax, 0x14a68(%rip)     # 0x1d6a8
callq 0x7e40
movq 0x14a64(%rip), %rax     # 0x1d6b0
movq %rax, 0x14a65(%rip)     # 0x1d6b8
leaq 0x1a12(%rip), %rdi      # 0xa66c
movl $0x1, %esi
callq 0x2310
movq %rax, 0x14a55(%rip)     # 0x1d6c0
cmpl $0x1, -0x8(%rbp)
jne 0x8c76
callq 0x8e30
movl -0x8(%rbp), %edi
movq -0x10(%rbp), %rsi
callq 0x8f90
movq -0x10(%rbp), %rax
movq 0x4343(%rip), %rcx      # 0xcfd0
movslq (%rcx), %rcx
cmpq $0x0, (%rax,%rcx,8)
jne 0x8ca3
movl $0x8, %edi
movb $0x0, %al
callq 0x8570
movq -0x10(%rbp), %rax
movq 0x4322(%rip), %rcx      # 0xcfd0
movl (%rcx), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
cmpq $0x0, (%rax,%rcx,8)
je 0x8d16
cmpl $0x1, 0x14a04(%rip)     # 0x1d6c8
jne 0x8cd2
movl $0x9, %edi
movb $0x0, %al
callq 0x8570
movq -0x10(%rbp), %rax
movq 0x42f3(%rip), %rcx      # 0xcfd0
movl (%rcx), %ecx
addl $0x2, %ecx
movslq %ecx, %rcx
cmpq $0x0, (%rax,%rcx,8)
je 0x8cf8
movl $0x9, %edi
movb $0x0, %al
callq 0x8570
movq -0x10(%rbp), %rax
movq 0x42cd(%rip), %rcx      # 0xcfd0
movl (%rcx), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
movq %rax, 0x149e2(%rip)     # 0x1d6f8
movq -0x10(%rbp), %rax
movq 0x42af(%rip), %rcx      # 0xcfd0
movslq (%rcx), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, 0x149c1(%rip)     # 0x1d6f0
movq 0x149ba(%rip), %rdi     # 0x1d6f0
leaq 0x1302(%rip), %rsi      # 0xa03f
callq 0x2270
cmpl $0x0, %eax
je 0x8dae
movq 0x149a2(%rip), %rdi     # 0x1d6f0
leaq 0x132a(%rip), %rsi      # 0xa07f
callq 0x23e0
movq %rax, 0x1499f(%rip)     # 0x1d700
cmpq $0x0, 0x14997(%rip)     # 0x1d700
jne 0x8d77
movq 0x1497e(%rip), %rdi     # 0x1d6f0
callq 0x8960
movq 0x14982(%rip), %rdi     # 0x1d700
callq 0x2300
movl %eax, %edi
leaq -0x140(%rbp), %rsi
callq 0x24f0
movl -0x128(%rbp), %eax
andl $0xf000, %eax           # imm = 0xF000
cmpl $0x8000, %eax           # imm = 0x8000
sete %al
andb $0x1, %al
movb %al, 0x1495c(%rip)      # 0x1d708
jmp 0x8dbf
movq 0x4213(%rip), %rax      # 0xcfc8
movq (%rax), %rax
movq %rax, 0x14941(%rip)     # 0x1d700
callq 0x4f80
movq 0x148e5(%rip), %rax     # 0x1d6b0
cmpl $0x2, (%rax)
jne 0x8dd7
callq 0x5f80
jmp 0x8ddc
callq 0x9490
cmpl $0x4, 0x14929(%rip)     # 0x1d70c
jae 0x8df1
movl $0x2, %edi
movb $0x0, %al
callq 0x8690
callq 0x4750
xorl %eax, %eax
addq $0x150, %rsp            # imm = 0x150
popq %rbp
retq
nopw %cs:(%rax,%rax)