// File: /workspace/github_c_makefile_star2_O2/cirocosta[P]stress/src/write.c
// Function: main
int
main(int argc, char** argv)
{
	stress_args_t args = { 0 };
	pthread_t threads[2];

	stress_parse_args(argc, argv, &args);
	_STRESS_MUST(strlen(args.d), "a base directory must be specified");

	thread_arg_t thread1arg = { .count = args.n,
		                    .base_dir = args.d,
		                    .thread_num = 0 };
	thread_arg_t thread2arg = { .count = args.n,
		                    .base_dir = args.d,
		                    .thread_num = 1 };

	srand(time(NULL));

	_STRESS_MUST(
	  (!pthread_create(&threads[0], NULL, &thread_handler, &thread1arg)),
	  "Unexpected error creating stdout thread");
	_STRESS_MUST(
	  (!pthread_create(&threads[1], NULL, &thread_handler, &thread2arg)),
	  "Unexpected error creating stderr thread");

	_STRESS_MUST((!pthread_join(threads[0], NULL)),
	             "Unexpected error waiting for stdout thread");

	_STRESS_MUST((!pthread_join(threads[1], NULL)),
	             "Unexpected error waiting for stderr thread");

	return 0;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x2040, %rsp           # imm = 0x2040
movq %rsi, %rbx
movl %edi, %ebp
leaq 0x38(%rsp), %r14
movl $0x2008, %edx           # imm = 0x2008
movq %r14, %rdi
xorl %esi, %esi
callq 0x10b0
movl %ebp, %edi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x132d
cmpb $0x0, 0x1005(%r14)
je 0x1ba2
leaq 0x103d(%rsp), %rax
leaq 0x28(%rsp), %rbx
movq %rax, (%rbx)
andl $0x0, 0x8(%rbx)
movl -0x1005(%rax), %ecx
movl %ecx, 0xc(%rbx)
movq %rax, 0x18(%rsp)
movl $0x1, 0x20(%rsp)
movl %ecx, 0x24(%rsp)
xorl %edi, %edi
callq 0x1100
movl %eax, %edi
callq 0x10e0
leaq -0x43a(%rip), %rdx      # 0x16fe
movq %rsp, %rdi
xorl %esi, %esi
movq %rbx, %rcx
callq 0x1130
testl %eax, %eax
jne 0x1c29
leaq 0x8(%rsp), %rdi
leaq -0x45b(%rip), %rdx      # 0x16fe
leaq 0x18(%rsp), %rcx
xorl %esi, %esi
callq 0x1130
testl %eax, %eax
jne 0x1cb0
movq (%rsp), %rdi
xorl %esi, %esi
callq 0x11a0
testl %eax, %eax
jne 0x1d37
movq 0x8(%rsp), %rdi
xorl %esi, %esi
callq 0x11a0
testl %eax, %eax
jne 0x1dbe
xorl %eax, %eax
addq $0x2040, %rsp           # imm = 0x2040
popq %rbx
popq %r14
popq %rbp
retq
movq 0x244f(%rip), %r14      # 0x3ff8
movq (%r14), %rcx
leaq 0x46d(%rip), %rdi       # 0x2020
pushq $0x9
popq %rsi
pushq $0x1
popq %rbx
movq %rbx, %rdx
callq 0x1190
movq (%r14), %rcx
leaq 0x45b(%rip), %rdi       # 0x2026
pushq $0x3
popq %rsi
movq %rbx, %rdx
callq 0x1190
movq (%r14), %rcx
leaq 0x5fe(%rip), %rdi       # 0x21de
pushq $0x22
popq %rsi
movq %rbx, %rdx
callq 0x1190
movq (%r14), %rcx
leaq 0x458(%rip), %rdi       # 0x204d
pushq $0x2
popq %rsi
movq %rbx, %rdx
callq 0x1190
movq (%r14), %rdi
leaq 0x446(%rip), %rsi       # 0x2050
leaq 0x522(%rip), %rdx       # 0x2133
xorl %eax, %eax
callq 0x10f0
movq (%r14), %rdi
leaq 0x44a(%rip), %rsi       # 0x206c
pushq $0x46
jmp 0x1e40
movq 0x23c8(%rip), %r14      # 0x3ff8
movq (%r14), %rcx
leaq 0x3e6(%rip), %rdi       # 0x2020
pushq $0x9
popq %rsi
pushq $0x1
popq %rbx
movq %rbx, %rdx
callq 0x1190
movq (%r14), %rcx
leaq 0x3d4(%rip), %rdi       # 0x2026
pushq $0x3
popq %rsi
movq %rbx, %rdx
callq 0x1190
movq (%r14), %rcx
leaq 0x59a(%rip), %rdi       # 0x2201
pushq $0x27
popq %rsi
movq %rbx, %rdx
callq 0x1190
movq (%r14), %rcx
leaq 0x3d1(%rip), %rdi       # 0x204d
pushq $0x2
popq %rsi
movq %rbx, %rdx
callq 0x1190
movq (%r14), %rdi
leaq 0x3bf(%rip), %rsi       # 0x2050
leaq 0x49b(%rip), %rdx       # 0x2133
xorl %eax, %eax
callq 0x10f0
movq (%r14), %rdi
leaq 0x3c3(%rip), %rsi       # 0x206c
pushq $0x53
jmp 0x1e40
movq 0x2341(%rip), %r14      # 0x3ff8
movq (%r14), %rcx
leaq 0x35f(%rip), %rdi       # 0x2020
pushq $0x9
popq %rsi
pushq $0x1
popq %rbx
movq %rbx, %rdx
callq 0x1190
movq (%r14), %rcx
leaq 0x34d(%rip), %rdi       # 0x2026
pushq $0x3
popq %rsi
movq %rbx, %rdx
callq 0x1190
movq (%r14), %rcx
leaq 0x53b(%rip), %rdi       # 0x2229
pushq $0x27
popq %rsi
movq %rbx, %rdx
callq 0x1190
movq (%r14), %rcx
leaq 0x34a(%rip), %rdi       # 0x204d
pushq $0x2
popq %rsi
movq %rbx, %rdx
callq 0x1190
movq (%r14), %rdi
leaq 0x338(%rip), %rsi       # 0x2050
leaq 0x414(%rip), %rdx       # 0x2133
xorl %eax, %eax
callq 0x10f0
movq (%r14), %rdi
leaq 0x33c(%rip), %rsi       # 0x206c
pushq $0x56
jmp 0x1e40
movq 0x22ba(%rip), %r14      # 0x3ff8
movq (%r14), %rcx
leaq 0x2d8(%rip), %rdi       # 0x2020
pushq $0x9
popq %rsi
pushq $0x1
popq %rbx
movq %rbx, %rdx
callq 0x1190
movq (%r14), %rcx
leaq 0x2c6(%rip), %rdi       # 0x2026
pushq $0x3
popq %rsi
movq %rbx, %rdx
callq 0x1190
movq (%r14), %rcx
leaq 0x4dc(%rip), %rdi       # 0x2251
pushq $0x2a
popq %rsi
movq %rbx, %rdx
callq 0x1190
movq (%r14), %rcx
leaq 0x2c3(%rip), %rdi       # 0x204d
pushq $0x2
popq %rsi
movq %rbx, %rdx
callq 0x1190
movq (%r14), %rdi
leaq 0x2b1(%rip), %rsi       # 0x2050
leaq 0x38d(%rip), %rdx       # 0x2133
xorl %eax, %eax
callq 0x10f0
movq (%r14), %rdi
leaq 0x2b5(%rip), %rsi       # 0x206c
pushq $0x59
jmp 0x1e40
movq 0x2233(%rip), %r14      # 0x3ff8
movq (%r14), %rcx
leaq 0x251(%rip), %rdi       # 0x2020
pushq $0x9
popq %rsi
pushq $0x1
popq %rbx
movq %rbx, %rdx
callq 0x1190
movq (%r14), %rcx
leaq 0x23f(%rip), %rdi       # 0x2026
pushq $0x3
popq %rsi
movq %rbx, %rdx
callq 0x1190
movq (%r14), %rcx
leaq 0x480(%rip), %rdi       # 0x227c
pushq $0x2a
popq %rsi
movq %rbx, %rdx
callq 0x1190
movq (%r14), %rcx
leaq 0x23c(%rip), %rdi       # 0x204d
pushq $0x2
popq %rsi
movq %rbx, %rdx
callq 0x1190
movq (%r14), %rdi
leaq 0x22a(%rip), %rsi       # 0x2050
leaq 0x306(%rip), %rdx       # 0x2133
xorl %eax, %eax
callq 0x10f0
movq (%r14), %rdi
leaq 0x22e(%rip), %rsi       # 0x206c
pushq $0x5c
popq %rdx
xorl %eax, %eax
callq 0x10f0
movq (%r14), %rsi
pushq $0xa
popq %rdi
callq 0x10c0
movq (%r14), %rcx
leaq 0x21c(%rip), %rdi       # 0x2079
pushq $0xa
popq %rsi
movq %rbx, %rdx
callq 0x1190
pushq $0x1
popq %rdi
callq 0x1180