// File: /workspace/github_c_makefile_star2_O0/inflex[P]ripMIME/ripOLE/ripole.c
// Function: main
int main( int argc, char **argv )
{
	struct ripOLE_object role;
	struct OLE_object *ole = NULL;
	int result = 0;

	if (argc == 1) { fprintf (stdout, "%s\n", help); exit(1); }

	ole = malloc(sizeof(struct OLE_object));
	if (ole == NULL)
	{
		LOGGER_log("ripOLE: Cannot allocate memory for OLE object");
		return 1;
	}


	LOGGER_set_output_mode(_LOGGER_STDOUT);

	OLE_init(ole);
	ROLE_init(&role);

	ROLE_set_defaults( &role );
	ROLE_parse_parameters(&role, argc, argv);
	result = ROLE_validate(&role);
	if (result != 0) return result;

	ROLE_set_parameters(&role, ole);

	OLE_set_filename_report_fn(ole, ROLE_report_filename_decoded );

	result = OLE_decode_file( ole, role.inputfile, role.outputdir );
	OLE_decode_file_done(ole);

	if ((result != 0)) {
		if (role.verbose) {
			switch (result) {
				case OLEER_NO_INPUT_FILE:
				case OLEER_BAD_INPUT_FILE:
					LOGGER_log("Cannot locate input file '%s'",role.inputfile);
					break;
				case OLEER_NOT_OLE_FILE:
					LOGGER_log("File '%s' is not OLE2 format",role.inputfile);
					break;
				case OLEER_INSANE_OLE_FILE:
					LOGGER_log("OLE input file '%s' is insane", role.inputfile);
					break;
				default:
					LOGGER_log("ripOLE: decoding of %s resulted in error %d\n", role.inputfile, result );
			}
		}
		return result;
	}

	if (ole != NULL) free(ole);
	ROLE_done(&role);

	return result;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movl $0x0, -0x4(%rbp)
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq $0x0, -0x38(%rbp)
movl $0x0, -0x3c(%rbp)
cmpl $0x1, -0x8(%rbp)
jne 0x6a04
movq 0x55ee(%rip), %rax      # 0xbfd0
movq (%rax), %rdi
leaq 0x260e(%rip), %rsi      # 0x8ffa
leaq 0x579d(%rip), %rdx      # 0xc190
movb $0x0, %al
callq 0x10e0
movl $0x1, %edi
callq 0x1190
movl $0x478, %edi            # imm = 0x478
callq 0x1120
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x38(%rbp)
jne 0x6a33
leaq 0x261c(%rip), %rdi      # 0x903c
movb $0x0, %al
callq 0x5040
movl $0x1, -0x4(%rbp)
jmp 0x6b6d
movl $0x2, %edi
callq 0x4d10
movq -0x38(%rbp), %rdi
callq 0x1320
leaq -0x30(%rbp), %rdi
callq 0x68c0
leaq -0x30(%rbp), %rdi
callq 0x64b0
movl -0x8(%rbp), %esi
movq -0x10(%rbp), %rdx
leaq -0x30(%rbp), %rdi
callq 0x6500
leaq -0x30(%rbp), %rdi
callq 0x6960
movl %eax, -0x3c(%rbp)
cmpl $0x0, -0x3c(%rbp)
je 0x6a85
movl -0x3c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x6b6d
movq -0x38(%rbp), %rsi
leaq -0x30(%rbp), %rdi
callq 0x6830
movq -0x38(%rbp), %rdi
leaq -0x20d(%rip), %rsi      # 0x6890
callq 0x3350
movq -0x38(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x39f0
movl %eax, -0x3c(%rbp)
movq -0x38(%rbp), %rdi
callq 0x3500
cmpl $0x0, -0x3c(%rbp)
je 0x6b4e
cmpl $0x0, -0x2c(%rbp)
je 0x6b46
movl -0x3c(%rbp), %eax
movl %eax, -0x40(%rbp)
addl $-0x64, %eax
subl $0x2, %eax
jb 0x6af3
jmp 0x6adf
movl -0x40(%rbp), %eax
subl $0x66, %eax
je 0x6b07
jmp 0x6ae9
movl -0x40(%rbp), %eax
subl $0x67, %eax
je 0x6b1b
jmp 0x6b2f
movq -0x20(%rbp), %rsi
leaq 0x256c(%rip), %rdi      # 0x906a
movb $0x0, %al
callq 0x5040
jmp 0x6b44
movq -0x20(%rbp), %rsi
leaq 0x2576(%rip), %rdi      # 0x9088
movb $0x0, %al
callq 0x5040
jmp 0x6b44
movq -0x20(%rbp), %rsi
leaq 0x257f(%rip), %rdi      # 0x90a5
movb $0x0, %al
callq 0x5040
jmp 0x6b44
movq -0x20(%rbp), %rsi
movl -0x3c(%rbp), %edx
leaq 0x2586(%rip), %rdi      # 0x90c3
movb $0x0, %al
callq 0x5040
jmp 0x6b46
movl -0x3c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x6b6d
cmpq $0x0, -0x38(%rbp)
je 0x6b5e
movq -0x38(%rbp), %rdi
callq 0x1030
leaq -0x30(%rbp), %rdi
callq 0x6910
movl -0x3c(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq