// File: /workspace/github_c_makefile_star2_O3/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
pushq %r14
pushq %rbx
subq $0x130, %rsp            # imm = 0x130
movq %rsi, %rbx
movl %edi, %ebp
leaq 0x32c(%rip), %rax       # 0x74bb
leaq 0xa0(%rsp), %r14
movq %rax, -0x8(%r14)
movq %r14, %rdi
callq 0x2270
movq %r14, %rdi
movl $0x2, %esi
callq 0x24c0
movq %r14, %rdi
movl $0x3, %esi
callq 0x24c0
movq %r14, %rdi
movl $0xf, %esi
callq 0x24c0
movq %r14, %rdi
movl $0xd, %esi
callq 0x24c0
movl $0x0, 0x80(%r14)
leaq 0x98(%rsp), %r14
movl $0x2, %edi
movq %r14, %rsi
xorl %edx, %edx
callq 0x20d0
movl $0x3, %edi
movq %r14, %rsi
xorl %edx, %edx
callq 0x20d0
movl $0xf, %edi
movq %r14, %rsi
xorl %edx, %edx
callq 0x20d0
leaq 0x1498(%rip), %rsi      # 0x86b6
movl $0x6, %edi
callq 0x2350
movq (%rbx), %r14
cmpb $0x0, (%r14)
je 0x724b
movq %r14, %rdi
movl $0x2f, %esi
callq 0x2170
leaq 0x1(%rax), %rcx
testq %rax, %rax
cmoveq %r14, %rcx
jmp 0x7252
leaq 0x139e(%rip), %rcx      # 0x85f0
movq %rcx, 0x1540f(%rip)     # 0x1c668
callq 0x68a0
movq 0x1540b(%rip), %rax     # 0x1c670
movq %rax, 0x1540c(%rip)     # 0x1c678
leaq 0x137d(%rip), %rdi      # 0x85f0
movl $0x1, %esi
callq 0x22e0
movq %rax, 0x153fc(%rip)     # 0x1c680
cmpl $0x1, %ebp
je 0x74b6
movl %ebp, %edi
movq %rbx, %rsi
callq 0x75e8
movq 0x4d32(%rip), %r14      # 0xbfd0
movslq (%r14), %rax
cmpq $0x0, (%rbx,%rax,8)
jne 0x72b7
movl $0x8, %edi
xorl %eax, %eax
callq 0x6cf0
movslq (%r14), %rax
cmpq $0x0, 0x8(%rbx,%rax,8)
je 0x72fa
cmpl $0x1, 0x153c2(%rip)     # 0x1c688
jne 0x72d7
movl $0x9, %edi
xorl %eax, %eax
callq 0x6cf0
movslq (%r14), %rax
cmpq $0x0, 0x10(%rbx,%rax,8)
je 0x72ee
movl $0x9, %edi
xorl %eax, %eax
callq 0x6cf0
movslq (%r14), %rax
movq 0x8(%rbx,%rax,8), %rcx
movq %rcx, 0x153be(%rip)     # 0x1c6b8
movq (%rbx,%rax,8), %rdi
movq %rdi, 0x153ab(%rip)     # 0x1c6b0
cmpb $0x2d, (%rdi)
jne 0x7314
cmpb $0x0, 0x1(%rdi)
je 0x73d8
leaq 0xd62(%rip), %rsi       # 0x807d
callq 0x23c0
movq %rax, 0x15399(%rip)     # 0x1c6c0
testq %rax, %rax
jne 0x733f
movq 0x1537d(%rip), %rdi     # 0x1c6b0
callq 0x7025
movq 0x15381(%rip), %rax     # 0x1c6c0
movq %rax, %rdi
callq 0x22d0
leaq 0x8(%rsp), %rbx
movl %eax, %edi
movq %rbx, %rsi
callq 0x24b0
movl $0xf000, %eax           # imm = 0xF000
andl 0x18(%rbx), %eax
cmpl $0x8000, %eax           # imm = 0x8000
sete 0x1535e(%rip)           # 0x1c6c8
callq 0x4532
movq 0x152fa(%rip), %rax     # 0x1c670
cmpl $0x2, (%rax)
jne 0x7385
callq 0x511d
jmp 0x748e
leaq 0x8(%rsp), %rbx
movq %rbx, %rdi
callq 0x2480
movl $0x20000, %esi          # imm = 0x20000
movq %rbx, %rdi
callq 0x21d0
movq %rax, %r14
movq 0x15317(%rip), %rcx     # 0x1c6c0
movl $0x1, %esi
movl $0x20000, %edx          # imm = 0x20000
movq %rax, %rdi
callq 0x20e0
movq %rax, %rbx
cmpq $-0x1, %rax
je 0x73ee
cmpq $0x3, %rbx
ja 0x73f3
movl $0x1, %edi
xorl %eax, %eax
callq 0x6dcc
jmp 0x73f3
movq 0x4be9(%rip), %rax      # 0xbfc8
movq (%rax), %rax
movq %rax, 0x152d7(%rip)     # 0x1c6c0
jmp 0x736a
callq 0x6f57
cmpl $0x5367674f, (%r14)     # imm = 0x5367674F
je 0x7408
movl $0x1, %edi
xorl %eax, %eax
callq 0x6dcc
leaq 0x8(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rsi
callq 0x2210
movq %r14, %rdi
callq 0x4d91
movl $0x20000, %esi          # imm = 0x20000
movq %r14, %rdi
callq 0x21d0
movq 0x1528c(%rip), %rcx     # 0x1c6c0
movl $0x1, %esi
movl $0x20000, %edx          # imm = 0x20000
movq %rax, %rdi
callq 0x20e0
testq %rax, %rax
je 0x748e
leaq 0x8(%rsp), %rbx
movq %rbx, %rdi
movq %rax, %rsi
callq 0x2210
movq %rbx, %rdi
callq 0x4d91
movl $0x20000, %esi          # imm = 0x20000
movq %rbx, %rdi
callq 0x21d0
movq 0x15249(%rip), %rcx     # 0x1c6c0
movl $0x1, %esi
movl $0x20000, %edx          # imm = 0x20000
movq %rax, %rdi
callq 0x20e0
testq %rax, %rax
jne 0x7450
cmpl $0x3, 0x15237(%rip)     # 0x1c6cc
ja 0x74a3
movl $0x2, %edi
xorl %eax, %eax
callq 0x6dcc
callq 0x3ec0
xorl %eax, %eax
addq $0x130, %rsp            # imm = 0x130
popq %rbx
popq %r14
popq %rbp
retq
callq 0x74c6