// File: /workspace/github_c_makefile_star2_O2/cirocosta[P]stress/src/locks.c
// Function: create_file
void
create_file(const char* base, const int i)
{
	FILE* fp;
	char* filename;

	_STRESS_MUST(asprintf(&filename, "%s/file%d", base, i) > 0,
	             "Couldn't create name for file %d",
	             i);
	_STRESS_MUST(
	  (fp = fopen(filename, "a")), "Couldn't create file %s", filename);

	_STRESS_MUST_P(!flock(fileno(fp), LOCK_EX),
	               "flock",
	               "Couldn't acquire lock on %s",
	               filename);

	fprintf(fp, "dummy");
	free(filename);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movl %esi, %ebp
movq %rdi, %rdx
leaq 0x9f7(%rip), %rsi       # 0x210d
leaq 0x8(%rsp), %rdi
movl %ebp, %ecx
xorl %eax, %eax
callq 0x1140
testl %eax, %eax
jle 0x178b
movq 0x8(%rsp), %rdi
leaq 0xa10(%rip), %rsi       # 0x2144
callq 0x1150
testq %rax, %rax
je 0x1810
movq %rax, %rbx
movq %rax, %rdi
callq 0x1130
pushq $0x2
popq %rsi
movl %eax, %edi
callq 0x1180
testl %eax, %eax
jne 0x18ae
leaq 0xa2b(%rip), %rdi       # 0x2191
pushq $0x5
popq %rsi
pushq $0x1
popq %rdx
movq %rbx, %rcx
callq 0x11b0
movq 0x8(%rsp), %rdi
callq 0x1030
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq 0x2866(%rip), %r14      # 0x3ff8
movq (%r14), %rcx
leaq 0x9e5(%rip), %rdi       # 0x2181
pushq $0x9
popq %rsi
pushq $0x1
popq %rbx
movq %rbx, %rdx
callq 0x11b0
movq (%r14), %rcx
leaq 0x9d3(%rip), %rdi       # 0x2187
pushq $0x3
popq %rsi
movq %rbx, %rdx
callq 0x11b0
movq (%r14), %rdi
leaq 0x94e(%rip), %rsi       # 0x2117
movl %ebp, %edx
xorl %eax, %eax
callq 0x1110
movq (%r14), %rcx
leaq 0x876(%rip), %rdi       # 0x2052
pushq $0x2
popq %rsi
movq %rbx, %rdx
callq 0x11b0
movq (%r14), %rdi
leaq 0x864(%rip), %rsi       # 0x2055
leaq 0x940(%rip), %rdx       # 0x2138
xorl %eax, %eax
callq 0x1110
movq (%r14), %rdi
leaq 0x868(%rip), %rsi       # 0x2071
pushq $0x1d
jmp 0x1893
movq 0x27e1(%rip), %r14      # 0x3ff8
movq (%r14), %rcx
leaq 0x960(%rip), %rdi       # 0x2181
pushq $0x9
popq %rsi
pushq $0x1
popq %rbx
movq %rbx, %rdx
callq 0x11b0
movq (%r14), %rcx
leaq 0x94e(%rip), %rdi       # 0x2187
pushq $0x3
popq %rsi
movq %rbx, %rdx
callq 0x11b0
movq (%r14), %rdi
movq 0x8(%rsp), %rdx
leaq 0x8f3(%rip), %rsi       # 0x2146
xorl %eax, %eax
callq 0x1110
movq (%r14), %rcx
leaq 0x7ee(%rip), %rdi       # 0x2052
pushq $0x2
popq %rsi
movq %rbx, %rdx
callq 0x11b0
movq (%r14), %rdi
leaq 0x7dc(%rip), %rsi       # 0x2055
leaq 0x8b8(%rip), %rdx       # 0x2138
xorl %eax, %eax
callq 0x1110
movq (%r14), %rdi
leaq 0x7e0(%rip), %rsi       # 0x2071
pushq $0x1f
popq %rdx
xorl %eax, %eax
callq 0x1110
movq (%r14), %rsi
pushq $0xa
popq %rdi
callq 0x10f0
movq (%r14), %rcx
jmp 0x198a
movq 0x2743(%rip), %r12      # 0x3ff8
movq (%r12), %rcx
leaq 0x8c1(%rip), %rdi       # 0x2181
pushq $0x9
popq %rsi
pushq $0x1
popq %rbx
movq %rbx, %rdx
callq 0x11b0
movq (%r12), %rcx
leaq 0x8ae(%rip), %r14       # 0x2187
pushq $0x3
popq %r15
movq %r14, %rdi
movq %r15, %rsi
movq %rbx, %rdx
callq 0x11b0
movq (%r12), %rdi
movq 0x8(%rsp), %rdx
leaq 0x863(%rip), %rsi       # 0x215e
xorl %eax, %eax
callq 0x1110
movq (%r12), %rcx
leaq 0x745(%rip), %rdi       # 0x2052
pushq $0x2
popq %rsi
movq %rbx, %rdx
callq 0x11b0
movq (%r12), %rdi
leaq 0x732(%rip), %rsi       # 0x2055
leaq 0x80e(%rip), %rdx       # 0x2138
xorl %eax, %eax
callq 0x1110
movq (%r12), %rdi
leaq 0x735(%rip), %rsi       # 0x2071
pushq $0x24
popq %rdx
xorl %eax, %eax
callq 0x1110
movq (%r12), %rsi
pushq $0xa
popq %rdi
callq 0x10f0
movq (%r12), %rcx
leaq 0x81d(%rip), %rdi       # 0x217a
pushq $0x10
popq %rsi
movq %rbx, %rdx
callq 0x11b0
leaq 0x81c(%rip), %rdi       # 0x218b
callq 0x1160
movq (%r12), %rcx
movq %r14, %rdi
movq %r15, %rsi
movq %rbx, %rdx
callq 0x11b0
movq (%r12), %rcx
leaq 0x6ed(%rip), %rdi       # 0x207e
pushq $0xa
popq %rsi
movq %rbx, %rdx
callq 0x11b0
pushq $0x1
popq %rdi
callq 0x11a0