// File: /workspace/github_c_makefile_star2_O0/hcmiya[P]opuscomment/src/main.c
// Function: parse_args
static void parse_args(int argc, char **argv) {
	int c;
	bool added_tag = false, del_tag = false;
	int gainfmt;
	double gv;
	
	while ((c = getopt(argc, argv, "01ac:C:d:Deg:hi:lpqQrRs:t:TUvVw~")) != -1) {
		switch (c) {
		case 'l':
			O.edit = EDIT_LIST;
			break;
			
		case 'w':
			O.edit = EDIT_WRITE;
			break;
			
		case 'a':
			O.edit = EDIT_APPEND;
			break;
			
		case 'h':
			usage();
			break;
			
		case 'g':
		case 's':
			gainfmt = c;
			O.gain_fix = true;
			{
				char *endp;
				gv = strtod(optarg, &endp);
				if (optarg == endp) {
					fail_to_parse(c);
				}
				if (!isfinite(gv)) {
					out_of_range(c);
				}
				if (gv > 65536 || gv < -65536) {
					out_of_range(c);
				}
			}
			break;
			
		case 'r':
			O.gain_relative = true;
			break;
			
		case 'Q':
			O.gain_q78 = true;
			break;
			
		case '1':
			O.gain_not_zero = true;
			break;
			
		case 'p':
			O.tag_ignore_picture = true;
			break;
			
		case 'R':
			O.tag_raw = true;
			break;
			
		case '~':
			O.tag_escape_tilde = true;
			break;
			
		case 'e':
			O.tag_escape = TAG_ESCAPE_BACKSLASH;
			break;
			
		case '0':
			O.tag_escape = TAG_ESCAPE_NUL;
			break;
			
		case 'U':
			O.tag_toupper = true;
			break;
			
		case 'v':
			O.gain_put = true;
			break;
			
		case 'c':
			O.tag_filename = optarg;
			break;
		
		case 't':
			parse_opt_tag(c, optarg);
			added_tag = true;
			break;
			
		case 'd':
			parse_opt_tag(c, optarg);
			del_tag = true;
			break;
			
		case 'D':
			O.tag_deferred = true;
			O.tag_verify = true;
			O.tag_check_line_term = true;
			break;
		case 'T':
			O.tag_check_line_term = true;
			break;
		case 'V':
			O.tag_verify = true;
			break;
		case 'i':
			{
				char *endp;
				unsigned long val = strtoul(optarg, &endp, 10);
				if (endp == optarg || *endp != '\0') {
					fail_to_parse(c);
				}
				if (errno == ERANGE || val == 0 || val > INT_MAX) {
					out_of_range(c);
				}
				O.target_idx = (int)val;
			}
			break;
			
		case 'q':
			// 何もしない
			break;
			
		case 'C':
			if (!select_codec_by_name(optarg)) {
				opterror(c, catgets(catd, 7, 4, "unknown codec \"%s\""), optarg);
			}
			break;
			
		case '?':
			exit(1);
			break;
		}
	}
	// オプションループ抜け
	if (del_tag || added_tag) {
		pticonv_close();
	}
	if (del_tag) {
		switch (O.edit) {
		case EDIT_NONE:
			O.edit = EDIT_APPEND;
			break;
		case EDIT_APPEND:
			break;
		default:
			mainerror(err_main_del_without_a);
		}
	}
	if (added_tag && O.edit == EDIT_LIST) {
		mainerror(err_main_tag_with_l);
	}
	if (added_tag && !O.edit) {
		mainerror(err_main_tag_without_aw);
	}
	if (!O.gain_fix && !O.edit) {
		O.edit = EDIT_LIST;
	}
	else if (O.gain_fix) {
		switch (gainfmt) {
		case 'g':
			if (O.gain_q78) {
				O.gain_val = (int)trunc(gv);
			}
			else {
				O.gain_val = (int)trunc(gv * 256);
			}
			break;
		case 's':
			if (gv <= 0) {
				out_of_range(gainfmt);
			}
			O.gain_val = (int)trunc(20 * log10(gv) * 256);
			break;
		}
		O.gain_val_sign = signbit(gv);
		if (!O.gain_relative && (O.gain_val > 32767 || O.gain_val < -32768)) {
			out_of_range(gainfmt);
		}
		
		if (O.edit == EDIT_LIST) {
			mainerror(err_main_gain_with_l);
		}
		else if (!O.edit) {
			if (O.tag_filename/* || added_tag*/) {
				mainerror(err_main_tag_without_aw);
			}
		}
	}
	if (O.edit == EDIT_APPEND) {
		O.tag_ignore_picture = false;
	}
	if (codec->prog) {
		O.gain_fix = false;
		O.gain_put = false;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movl %edi, -0x4(%rbp)
movq %rsi, -0x10(%rbp)
movb $0x0, -0x15(%rbp)
movb $0x0, -0x16(%rbp)
movl -0x4(%rbp), %edi
movq -0x10(%rbp), %rsi
leaq 0x1eb7(%rip), %rdx      # 0xae6c
callq 0x2410
movl %eax, -0x14(%rbp)
cmpl $-0x1, %eax
je 0x9290
movl -0x14(%rbp), %eax
addl $-0x30, %eax
movl %eax, %ecx
movq %rcx, -0x48(%rbp)
subl $0x4e, %eax
ja 0x928b
movq -0x48(%rbp), %rax
leaq 0x154a(%rip), %rcx      # 0xa530
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl $0x1, 0x146cf(%rip)     # 0x1d6c8
jmp 0x928b
movl $0x2, 0x146c0(%rip)     # 0x1d6c8
jmp 0x928b
movl $0x3, 0x146b1(%rip)     # 0x1d6c8
jmp 0x928b
callq 0x8e30
jmp 0x928b
movl -0x14(%rbp), %eax
movl %eax, -0x1c(%rbp)
movb $0x1, 0x14699(%rip)     # 0x1d6cc
movq 0x3f9e(%rip), %rax      # 0xcfd8
movq (%rax), %rdi
leaq -0x30(%rbp), %rsi
callq 0x20f0
movsd %xmm0, -0x28(%rbp)
movq 0x3f86(%rip), %rax      # 0xcfd8
movq (%rax), %rax
cmpq -0x30(%rbp), %rax
jne 0x9063
movl -0x14(%rbp), %edi
callq 0x9590
movsd -0x28(%rbp), %xmm0
movq %xmm0, %rax
movabsq $0x7fffffffffffffff, %rcx # imm = 0x7FFFFFFFFFFFFFFF
andq %rcx, %rax
movabsq $0x7ff0000000000000, %rcx # imm = 0x7FF0000000000000
subq %rcx, %rax
setl %al
testb $0x1, %al
jne 0x9096
movl -0x14(%rbp), %edi
callq 0x95e0
movsd -0x28(%rbp), %xmm0
movsd 0x147d(%rip), %xmm1     # 0xa520
ucomisd %xmm1, %xmm0
ja 0x90b8
movsd 0x1477(%rip), %xmm0     # 0xa528
ucomisd -0x28(%rbp), %xmm0
jbe 0x90c0
movl -0x14(%rbp), %edi
callq 0x95e0
jmp 0x928b
movb $0x1, 0x14601(%rip)     # 0x1d6cd
jmp 0x928b
movb $0x1, 0x145f7(%rip)     # 0x1d6cf
jmp 0x928b
movb $0x1, 0x145ea(%rip)     # 0x1d6ce
jmp 0x928b
movb $0x1, 0x145e6(%rip)     # 0x1d6d6
jmp 0x928b
movb $0x1, 0x145e1(%rip)     # 0x1d6dd
jmp 0x928b
movb $0x1, 0x145d4(%rip)     # 0x1d6dc
jmp 0x928b
movl $0x1, 0x145c1(%rip)     # 0x1d6d8
jmp 0x928b
movl $0x2, 0x145b2(%rip)     # 0x1d6d8
jmp 0x928b
movb $0x1, 0x145ac(%rip)     # 0x1d6de
jmp 0x928b
movb $0x1, 0x14597(%rip)     # 0x1d6d5
jmp 0x928b
movq 0x3e8e(%rip), %rax      # 0xcfd8
movq (%rax), %rax
movq %rax, 0x1458c(%rip)     # 0x1d6e0
jmp 0x928b
movl -0x14(%rbp), %edi
movq 0x3e75(%rip), %rax      # 0xcfd8
movq (%rax), %rsi
callq 0x3b20
movb $0x1, -0x15(%rbp)
jmp 0x928b
movl -0x14(%rbp), %edi
movq 0x3e5a(%rip), %rax      # 0xcfd8
movq (%rax), %rsi
callq 0x3b20
movb $0x1, -0x16(%rbp)
jmp 0x928b
movb $0x1, 0x14552(%rip)     # 0x1d6e8
movb $0x1, 0x1454c(%rip)     # 0x1d6e9
movb $0x1, 0x14546(%rip)     # 0x1d6ea
jmp 0x928b
movb $0x1, 0x1453a(%rip)     # 0x1d6ea
jmp 0x928b
movb $0x1, 0x1452d(%rip)     # 0x1d6e9
jmp 0x928b
movq 0x3e10(%rip), %rax      # 0xcfd8
movq (%rax), %rdi
leaq -0x38(%rbp), %rsi
movl $0xa, %edx
callq 0x2430
movq %rax, -0x40(%rbp)
movq -0x38(%rbp), %rax
movq 0x3df0(%rip), %rcx      # 0xcfd8
cmpq (%rcx), %rax
je 0x91f9
movq -0x38(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
je 0x9201
movl -0x14(%rbp), %edi
callq 0x9590
callq 0x2050
cmpl $0x22, (%rax)
je 0x921c
cmpq $0x0, -0x40(%rbp)
je 0x921c
cmpq $0x7fffffff, -0x40(%rbp) # imm = 0x7FFFFFFF
jbe 0x9224
movl -0x14(%rbp), %edi
callq 0x95e0
movq -0x40(%rbp), %rax
movl %eax, 0x144be(%rip)     # 0x1d6ec
jmp 0x928b
jmp 0x928b
movq 0x3d9f(%rip), %rax      # 0xcfd8
movq (%rax), %rdi
callq 0x7ef0
testb $0x1, %al
jne 0x927f
movl -0x14(%rbp), %eax
movl %eax, -0x4c(%rbp)
movq 0x1446e(%rip), %rdi     # 0x1d6c0
movl $0x7, %esi
movl $0x4, %edx
leaq 0x1c2a(%rip), %rcx      # 0xae8d
callq 0x2460
movl -0x4c(%rbp), %edi
movq %rax, %rsi
movq 0x3d63(%rip), %rax      # 0xcfd8
movq (%rax), %rdx
movb $0x0, %al
callq 0x89d0
jmp 0x928b
movl $0x1, %edi
callq 0x2480
jmp 0x8fa7
testb $0x1, -0x16(%rbp)
jne 0x929c
testb $0x1, -0x15(%rbp)
je 0x92a1
callq 0x3cc0
testb $0x1, -0x16(%rbp)
je 0x92dc
movl 0x1441b(%rip), %eax     # 0x1d6c8
movl %eax, -0x50(%rbp)
testl %eax, %eax
je 0x92c0
jmp 0x92b6
movl -0x50(%rbp), %eax
subl $0x3, %eax
je 0x92cc
jmp 0x92ce
movl $0x3, 0x143fe(%rip)     # 0x1d6c8
jmp 0x92da
jmp 0x92da
movl $0xe, %edi
movb $0x0, %al
callq 0x8570
jmp 0x92dc
testb $0x1, -0x15(%rbp)
je 0x92f7
cmpl $0x1, 0x143df(%rip)     # 0x1d6c8
jne 0x92f7
movl $0x5, %edi
movb $0x0, %al
callq 0x8570
testb $0x1, -0x15(%rbp)
je 0x9312
cmpl $0x0, 0x143c4(%rip)     # 0x1d6c8
jne 0x9312
movl $0x6, %edi
movb $0x0, %al
callq 0x8570
testb $0x1, 0x143b3(%rip)     # 0x1d6cc
jne 0x9333
cmpl $0x0, 0x143a6(%rip)     # 0x1d6c8
jne 0x9333
movl $0x1, 0x1439a(%rip)     # 0x1d6c8
jmp 0x945d
testb $0x1, 0x14392(%rip)     # 0x1d6cc
je 0x945b
movl -0x1c(%rbp), %eax
movl %eax, -0x54(%rbp)
subl $0x67, %eax
je 0x935a
jmp 0x934d
movl -0x54(%rbp), %eax
subl $0x73, %eax
je 0x9397
jmp 0x93dd
testb $0x1, 0x1436e(%rip)     # 0x1d6cf
je 0x9379
movsd -0x28(%rbp), %xmm0
callq 0x20a0
cvttsd2si %xmm0, %eax
movl %eax, 0x14359(%rip)     # 0x1d6d0
jmp 0x9395
movsd 0xd9f(%rip), %xmm0      # 0xa120
mulsd -0x28(%rbp), %xmm0
callq 0x20a0
cvttsd2si %xmm0, %eax
movl %eax, 0x1433b(%rip)     # 0x1d6d0
jmp 0x93dd
xorps %xmm0, %xmm0
ucomisd -0x28(%rbp), %xmm0
jb 0x93a9
movl -0x1c(%rbp), %edi
callq 0x95e0
movsd -0x28(%rbp), %xmm0
callq 0x2280
movaps %xmm0, %xmm1
movsd 0x115a(%rip), %xmm0     # 0xa518
mulsd %xmm1, %xmm0
movsd 0xd56(%rip), %xmm1      # 0xa120
mulsd %xmm1, %xmm0
callq 0x20a0
cvttsd2si %xmm0, %eax
movl %eax, 0x142f3(%rip)     # 0x1d6d0
movsd -0x28(%rbp), %xmm0
movq %xmm0, %rax
cmpq $0x0, %rax
setl %al
andb $0x1, %al
movb %al, 0x142de(%rip)      # 0x1d6d4
testb $0x1, 0x142d0(%rip)     # 0x1d6cd
jne 0x941f
cmpl $0x7fff, 0x142c7(%rip)  # imm = 0x7FFF
jg 0x9417
cmpl $0xffff8000, 0x142bb(%rip) # imm = 0xFFFF8000
jge 0x941f
movl -0x1c(%rbp), %edi
callq 0x95e0
cmpl $0x1, 0x142a2(%rip)     # 0x1d6c8
jne 0x9436
movl $0x7, %edi
movb $0x0, %al
callq 0x8570
jmp 0x9459
cmpl $0x0, 0x1428b(%rip)     # 0x1d6c8
jne 0x9457
cmpq $0x0, 0x14299(%rip)     # 0x1d6e0
je 0x9455
movl $0x6, %edi
movb $0x0, %al
callq 0x8570
jmp 0x9457
jmp 0x9459
jmp 0x945b
jmp 0x945d
cmpl $0x3, 0x14264(%rip)     # 0x1d6c8
jne 0x946d
movb $0x0, 0x14269(%rip)     # 0x1d6d6
movq 0x1423c(%rip), %rax     # 0x1d6b0
cmpq $0x0, 0x8(%rax)
je 0x9489
movb $0x0, 0x1424a(%rip)     # 0x1d6cc
movb $0x0, 0x1424c(%rip)     # 0x1d6d5
addq $0x60, %rsp
popq %rbp
retq
nop