// File: /workspace/github_c_makefile_star2_O0/tomka[P]cliaspora/file.c
// Function: write_postponed
static int
write_postponed(const char *path)
{
	int	    rd;
	FILE	    *in, *out;
	char	    *pp_path, buf[BUFSIZ];
	struct stat sb_in, sb_out;

	out = in = NULL;
	if ((pp_path = get_postponed_path()) == NULL)
		return (-1);
	/* Check whether infile == outfile. */
	if (stat(path, &sb_in) == -1) {
		warn("stat(%s)", path);
		goto error;
	}
	if (stat(pp_path, &sb_out) == -1 && errno != ENOENT) {
		warn("stat(%s)", pp_path);
		goto error;
	}
	if (sb_in.st_ino == sb_out.st_ino)
		/* Nothing to do here. */
		return (0);
	if ((in = fopen(path, "r")) == NULL) {
		warn("fopen(%s)", path);
		goto error;
	}
	if ((out = fopen(pp_path, "w+")) == NULL) {
		warn("Couldn't create '%s'", pp_path); 
		goto error;
	}
	while ((rd = fread(buf, 1, sizeof(buf), in)) > 0)
		(void)fwrite(buf, 1, rd, out);
	if (ferror(in)) {
		warn("fread()");
		goto error;
	} else if (ferror(out)) {
		warn("fwrite()");
		goto error;
	}
	(void)fclose(out); (void)fclose(in);

	return (0);
error:
	if (in != NULL)
		(void)fclose(in);
	if (out != NULL)
		(void)fclose(out);
	return (-1);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x2150, %rsp           # imm = 0x2150
movq %rdi, -0x10(%rbp)
movq $0x0, -0x20(%rbp)
movq $0x0, -0x28(%rbp)
callq 0xc9d0
movq %rax, -0x30(%rbp)
cmpq $0x0, %rax
jne 0xcfea
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0xd189
movq -0x10(%rbp), %rdi
leaq -0x20c0(%rbp), %rsi
callq 0x2280
cmpl $-0x1, %eax
jne 0xd016
movq -0x10(%rbp), %rsi
leaq 0x2c15(%rip), %rdi      # 0xfc1f
movb $0x0, %al
callq 0x2120
jmp 0xd162
movq -0x30(%rbp), %rdi
leaq -0x2150(%rbp), %rsi
callq 0x2280
cmpl $-0x1, %eax
jne 0xd04c
callq 0x2060
cmpl $0x2, (%rax)
je 0xd04c
movq -0x30(%rbp), %rsi
leaq 0x2bdf(%rip), %rdi      # 0xfc1f
movb $0x0, %al
callq 0x2120
jmp 0xd162
movq -0x20b8(%rbp), %rax
cmpq -0x2148(%rbp), %rax
jne 0xd068
movl $0x0, -0x4(%rbp)
jmp 0xd189
movq -0x10(%rbp), %rdi
leaq 0x19a3(%rip), %rsi      # 0xea16
callq 0x23b0
movq %rax, -0x20(%rbp)
cmpq $0x0, %rax
jne 0xd099
movq -0x10(%rbp), %rsi
leaq 0x24b2(%rip), %rdi      # 0xf53f
movb $0x0, %al
callq 0x2120
jmp 0xd162
movq -0x30(%rbp), %rdi
leaq 0x24f5(%rip), %rsi      # 0xf599
callq 0x23b0
movq %rax, -0x28(%rbp)
cmpq $0x0, %rax
jne 0xd0ca
movq -0x30(%rbp), %rsi
leaq 0x2be7(%rip), %rdi      # 0xfca5
movb $0x0, %al
callq 0x2120
jmp 0xd162
jmp 0xd0cc
leaq -0x2030(%rbp), %rdi
movq -0x20(%rbp), %rcx
movl $0x1, %esi
movl $0x2000, %edx           # imm = 0x2000
callq 0x24e0
movl %eax, -0x14(%rbp)
cmpl $0x0, %eax
jle 0xd109
leaq -0x2030(%rbp), %rdi
movslq -0x14(%rbp), %rdx
movq -0x28(%rbp), %rcx
movl $0x1, %esi
callq 0x25c0
jmp 0xd0cc
movq -0x20(%rbp), %rdi
callq 0x2590
cmpl $0x0, %eax
je 0xd127
leaq 0x2b7f(%rip), %rdi      # 0xfc9d
movb $0x0, %al
callq 0x2120
jmp 0xd162
movq -0x28(%rbp), %rdi
callq 0x2590
cmpl $0x0, %eax
je 0xd145
leaq 0x2b7e(%rip), %rdi      # 0xfcba
movb $0x0, %al
callq 0x2120
jmp 0xd162
jmp 0xd147
movq -0x28(%rbp), %rdi
callq 0x22a0
movq -0x20(%rbp), %rdi
callq 0x22a0
movl $0x0, -0x4(%rbp)
jmp 0xd189
cmpq $0x0, -0x20(%rbp)
je 0xd172
movq -0x20(%rbp), %rdi
callq 0x22a0
cmpq $0x0, -0x28(%rbp)
je 0xd182
movq -0x28(%rbp), %rdi
callq 0x22a0
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
movl -0x4(%rbp), %eax
addq $0x2150, %rsp           # imm = 0x2150
popq %rbp
retq
nopw %cs:(%rax,%rax)
nop