// File: /workspace/github_c_makefile_star2_O0/miniupnp[P]hfsplustools/src/hfsrename.c
// Function: main
int main(int argc, char * * argv)
{
	FILE * f;
	const char * isofile = NULL;
	const char * newname = NULL;
	int i;
	unsigned char * catalog = NULL;
	struct find_infos infos;

	for(i = 1; i < argc; i++) {
		if(isofile == NULL)
			isofile = argv[i];
		else if(newname == NULL)
			newname = argv[i];
		else {
			fprintf(stderr, "unrecognized argument : %s\n", argv[i]);
			return 1;
		}
	}
	if(isofile == NULL) {
		fprintf(stderr, "Usage: %s [] <image.iso> [new volume name]\n", argv[0]);
		return 1;
	}
	f = fopen(isofile, "rb");
	if(f == NULL) {
		fprintf(stderr, "cannot open %s for reading\n", isofile);
		return 2;
	}
	read_partition_map(f);
	if(hfs_part_sector == 0 && hfs_part_sector_count == 0) {
		printf("HFS/HFS+ partition not found\n");
		fclose(f);
		return 3;
	} else {
		read_hfs_volume_header(f);
		catalog = load_catalog(f);
		if(!print_node(catalog)) { /* header node */
			free(catalog);
			return 4;
		}
		/* root node */
		printf("\nroot node :\n");
		print_node(catalog + catalog_root_node * catalog_node_size);
		if(hfs_find(catalog, 1, NULL, &infos)) {
			printf("Root Folder found : id=%u\n", infos.folder_id);
			//
		}
	}
	fclose(f);
	free(catalog);
	printf("\n! Warning : Does nothing !\n");
	/* this program is not finished ! */
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movl $0x0, -0x4(%rbp)
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq $0x0, -0x20(%rbp)
movq $0x0, -0x28(%rbp)
movq $0x0, -0x38(%rbp)
movl $0x1, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
cmpl -0x8(%rbp), %eax
jge 0x12ee
cmpq $0x0, -0x20(%rbp)
jne 0x1296
movq -0x10(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x20(%rbp)
jmp 0x12e1
cmpq $0x0, -0x28(%rbp)
jne 0x12af
movq -0x10(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x28(%rbp)
jmp 0x12df
movq 0x4d42(%rip), %rax      # 0x5ff8
movq (%rax), %rdi
movq -0x10(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movq (%rax,%rcx,8), %rdx
leaq 0x2d38(%rip), %rsi      # 0x4004
movb $0x0, %al
callq 0x10c0
movl $0x1, -0x4(%rbp)
jmp 0x1464
jmp 0x12e1
jmp 0x12e3
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x1275
cmpq $0x0, -0x20(%rbp)
jne 0x1320
movq 0x4cfc(%rip), %rax      # 0x5ff8
movq (%rax), %rdi
movq -0x10(%rbp), %rax
movq (%rax), %rdx
leaq 0x2d13(%rip), %rsi      # 0x4020
movb $0x0, %al
callq 0x10c0
movl $0x1, -0x4(%rbp)
jmp 0x1464
movq -0x20(%rbp), %rdi
leaq 0x2d21(%rip), %rsi      # 0x404c
callq 0x1100
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x1363
movq 0x4cb6(%rip), %rax      # 0x5ff8
movq (%rax), %rdi
movq -0x20(%rbp), %rdx
leaq 0x2cff(%rip), %rsi      # 0x404f
movb $0x0, %al
callq 0x10c0
movl $0x2, -0x4(%rbp)
jmp 0x1464
movq -0x18(%rbp), %rdi
callq 0x3160
leaq 0x4d41(%rip), %rax      # 0x60b4
cmpl $0x0, (%rax)
jne 0x13a7
leaq 0x4d39(%rip), %rax      # 0x60b8
cmpl $0x0, (%rax)
jne 0x13a7
leaq 0x2ce0(%rip), %rdi      # 0x406b
movb $0x0, %al
callq 0x1080
movq -0x18(%rbp), %rdi
callq 0x1070
movl $0x3, -0x4(%rbp)
jmp 0x1464
movq -0x18(%rbp), %rdi
callq 0x1630
movq -0x18(%rbp), %rdi
callq 0x2d10
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rdi
callq 0x1cf0
cmpl $0x0, %eax
jne 0x13e0
movq -0x38(%rbp), %rdi
callq 0x1030
movl $0x4, -0x4(%rbp)
jmp 0x1464
leaq 0x2ca2(%rip), %rdi      # 0x4089
movb $0x0, %al
callq 0x1080
movq -0x38(%rbp), %rdi
leaq 0x4ccf(%rip), %rax      # 0x60c8
movl (%rax), %eax
leaq 0x4cd2(%rip), %rcx      # 0x60d4
imull (%rcx), %eax
movl %eax, %eax
addq %rax, %rdi
callq 0x1cf0
movq -0x38(%rbp), %rdi
movl $0x1, %esi
xorl %eax, %eax
movl %eax, %edx
leaq -0x48(%rbp), %rcx
callq 0x2380
cmpl $0x0, %eax
je 0x143b
movl -0x40(%rbp), %esi
leaq 0x2c63(%rip), %rdi      # 0x4097
movb $0x0, %al
callq 0x1080
jmp 0x143d
movq -0x18(%rbp), %rdi
callq 0x1070
movq -0x38(%rbp), %rdi
callq 0x1030
leaq 0x2c5c(%rip), %rdi      # 0x40b2
movb $0x0, %al
callq 0x1080
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax)