// File: /workspace/github_c_makefile_star2_O1/findstr[P]version-database/main.c
// Function: patch_h
static void
patch_h(int argc, char *argv[])
{
	int c;
	struct patch_args args;
	memset(&args, 0, sizeof(args));
	while ((c = getopt(argc, argv, "a:p:o:?")) != -1) {
		switch (c) {
		case 'a':
			args.hash = dr_newstr(optarg);
			break;
		case 'p':
			args.patch = dr_newstr(optarg);
			break;
		case 'o':
			args.output = dr_newstr(optarg);
			break;
		case '?':
			exit(EINVAL);
			break;
		}
	}
	if (!(args.hash && args.patch && args.output)) {
		fprintf(stderr, "usage: %s patch -a hash -p patch -o output\n",
			argv[0]);
		exit(EINVAL);
	}
	patch(&args);
	dr_unref(args.hash);
	dr_unref(args.patch);
	dr_unref(args.output);
	return ;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %rbx
movl %edi, %r14d
xorps %xmm0, %xmm0
movaps %xmm0, -0x40(%rbp)
movq $0x0, -0x30(%rbp)
movl %r14d, %edi
movq %rbx, %rsi
leaq 0x71c5(%rip), %rdx      # 0xa14a
callq 0x2250
cmpl $0x6e, %eax
jle 0x2fe8
cmpl $0x6f, %eax
je 0x303f
cmpl $0x70, %eax
jne 0x2f78
movq 0xa034(%rip), %rax      # 0xcfd8
movq (%rax), %r12
movq %r12, %rdi
callq 0x20e0
movslq %eax, %r13
leaq 0xc(%r13), %rdi
callq 0x21f0
movq %rax, %r15
movl $0x1, (%rax)
movl %r13d, 0x4(%rax)
testq %r12, %r12
je 0x2fdc
leaq 0x8(%r15), %rdi
movq %r12, %rsi
movq %r13, %rdx
callq 0x21c0
movb $0x0, 0x8(%r15,%r13)
movq %r15, -0x38(%rbp)
jmp 0x2f78
cmpl $0x61, %eax
jne 0x308d
movq 0x9fe0(%rip), %rax      # 0xcfd8
movq (%rax), %r12
movq %r12, %rdi
callq 0x20e0
movslq %eax, %r13
leaq 0xc(%r13), %rdi
callq 0x21f0
movq %rax, %r15
movl $0x1, (%rax)
movl %r13d, 0x4(%rax)
testq %r12, %r12
je 0x3030
leaq 0x8(%r15), %rdi
movq %r12, %rsi
movq %r13, %rdx
callq 0x21c0
movb $0x0, 0x8(%r15,%r13)
movq %r15, -0x40(%rbp)
jmp 0x2f78
movq 0x9f92(%rip), %rax      # 0xcfd8
movq (%rax), %r12
movq %r12, %rdi
callq 0x20e0
movslq %eax, %r13
leaq 0xc(%r13), %rdi
callq 0x21f0
movq %rax, %r15
movl $0x1, (%rax)
movl %r13d, 0x4(%rax)
testq %r12, %r12
je 0x307e
leaq 0x8(%r15), %rdi
movq %r12, %rsi
movq %r13, %rdx
callq 0x21c0
movb $0x0, 0x8(%r15,%r13)
movq %r15, -0x30(%rbp)
jmp 0x2f78
cmpl $-0x1, %eax
je 0x30a5
cmpl $0x3f, %eax
jne 0x2f78
movl $0x16, %edi
callq 0x2270
cmpq $0x0, -0x40(%rbp)
je 0x3132
cmpq $0x0, -0x38(%rbp)
je 0x3132
cmpq $0x0, -0x30(%rbp)
je 0x3132
leaq -0x40(%rbp), %rbx
movq %rbx, %rdi
callq 0x4880
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x30e7
movl (%rdi), %ecx
leal -0x1(%rcx), %eax
movl %eax, (%rdi)
cmpl $0x1, %ecx
jg 0x30e7
testl %eax, %eax
jne 0x313a
callq 0x2030
movq -0x38(%rbp), %rdi
testq %rdi, %rdi
je 0x3105
movl (%rdi), %ecx
leal -0x1(%rcx), %eax
movl %eax, (%rdi)
cmpl $0x1, %ecx
jg 0x3105
testl %eax, %eax
jne 0x313a
callq 0x2030
movq -0x30(%rbp), %rdi
testq %rdi, %rdi
je 0x3123
movl (%rdi), %ecx
leal -0x1(%rcx), %eax
movl %eax, (%rdi)
cmpl $0x1, %ecx
jg 0x3123
testl %eax, %eax
jne 0x313a
callq 0x2030
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rbx, %rdi
callq 0x23a9
leaq 0x6f40(%rip), %rdi      # 0xa081
leaq 0x6f45(%rip), %rsi      # 0xa08d
leaq 0x6f45(%rip), %rcx      # 0xa094
movl $0x2d, %edx
callq 0x2130
nopl (%rax)