// File: /workspace/github_c_makefile_star2_O0/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:
subq $0x2048, %rsp           # imm = 0x2048
movl $0x0, 0x2044(%rsp)
movl %edi, 0x2040(%rsp)
movq %rsi, 0x2038(%rsp)
leaq 0x30(%rsp), %rdi
xorl %esi, %esi
movl $0x2008, %edx           # imm = 0x2008
callq 0x10b0
movl 0x2040(%rsp), %edi
movq 0x2038(%rsp), %rsi
leaq 0x30(%rsp), %rdx
callq 0x1350
leaq 0x30(%rsp), %rdi
addq $0x1005, %rdi           # imm = 0x1005
callq 0x1080
cmpq $0x0, %rax
jne 0x1ffc
movq 0x30cb(%rip), %rax      # 0x4ff8
movq (%rax), %rdi
leaq 0x1101(%rip), %rsi      # 0x3038
movb $0x0, %al
callq 0x10e0
movq 0x30b3(%rip), %rax      # 0x4ff8
movq (%rax), %rdi
leaq 0x10ef(%rip), %rsi      # 0x303e
movb $0x0, %al
callq 0x10e0
movq 0x309b(%rip), %rax      # 0x4ff8
movq (%rax), %rdi
leaq 0x128f(%rip), %rsi      # 0x31f6
movb $0x0, %al
callq 0x10e0
movq 0x3083(%rip), %rax      # 0x4ff8
movq (%rax), %rdi
leaq 0x10e6(%rip), %rsi      # 0x3065
movb $0x0, %al
callq 0x10e0
movq 0x306b(%rip), %rax      # 0x4ff8
movq (%rax), %rdi
leaq 0x10d1(%rip), %rsi      # 0x3068
leaq 0x11ad(%rip), %rdx      # 0x314b
movb $0x0, %al
callq 0x10e0
movq 0x304c(%rip), %rax      # 0x4ff8
movq (%rax), %rdi
leaq 0x10ce(%rip), %rsi      # 0x3084
movl $0x46, %edx
movb $0x0, %al
callq 0x10e0
movq 0x302f(%rip), %rax      # 0x4ff8
movq (%rax), %rdi
leaq 0x1093(%rip), %rsi      # 0x3066
movb $0x0, %al
callq 0x10e0
movq 0x3017(%rip), %rax      # 0x4ff8
movq (%rax), %rdi
leaq 0x10a6(%rip), %rsi      # 0x3091
movb $0x0, %al
callq 0x10e0
movl $0x1, %edi
callq 0x1170
jmp 0x1ffe
leaq 0x30(%rsp), %rax
addq $0x1005, %rax           # imm = 0x1005
movq %rax, 0x10(%rsp)
movl $0x0, 0x18(%rsp)
movl 0x30(%rsp), %eax
movl %eax, 0x1c(%rsp)
leaq 0x30(%rsp), %rax
addq $0x1005, %rax           # imm = 0x1005
movq %rax, (%rsp)
movl $0x1, 0x8(%rsp)
movl 0x30(%rsp), %eax
movl %eax, 0xc(%rsp)
xorl %eax, %eax
movl %eax, %edi
callq 0x10f0
movl %eax, %edi
callq 0x10d0
leaq 0x20(%rsp), %rdi
xorl %eax, %eax
movl %eax, %esi
leaq -0x74d(%rip), %rdx      # 0x1910
leaq 0x10(%rsp), %rcx
callq 0x1120
cmpl $0x0, %eax
je 0x2146
movq 0x2f81(%rip), %rax      # 0x4ff8
movq (%rax), %rdi
leaq 0xfb7(%rip), %rsi       # 0x3038
movb $0x0, %al
callq 0x10e0
movq 0x2f69(%rip), %rax      # 0x4ff8
movq (%rax), %rdi
leaq 0xfa5(%rip), %rsi       # 0x303e
movb $0x0, %al
callq 0x10e0
movq 0x2f51(%rip), %rax      # 0x4ff8
movq (%rax), %rdi
leaq 0x1168(%rip), %rsi      # 0x3219
movb $0x0, %al
callq 0x10e0
movq 0x2f39(%rip), %rax      # 0x4ff8
movq (%rax), %rdi
leaq 0xf9c(%rip), %rsi       # 0x3065
movb $0x0, %al
callq 0x10e0
movq 0x2f21(%rip), %rax      # 0x4ff8
movq (%rax), %rdi
leaq 0xf87(%rip), %rsi       # 0x3068
leaq 0x1063(%rip), %rdx      # 0x314b
movb $0x0, %al
callq 0x10e0
movq 0x2f02(%rip), %rax      # 0x4ff8
movq (%rax), %rdi
leaq 0xf84(%rip), %rsi       # 0x3084
movl $0x53, %edx
movb $0x0, %al
callq 0x10e0
movq 0x2ee5(%rip), %rax      # 0x4ff8
movq (%rax), %rdi
leaq 0xf49(%rip), %rsi       # 0x3066
movb $0x0, %al
callq 0x10e0
movq 0x2ecd(%rip), %rax      # 0x4ff8
movq (%rax), %rdi
leaq 0xf5c(%rip), %rsi       # 0x3091
movb $0x0, %al
callq 0x10e0
movl $0x1, %edi
callq 0x1170
jmp 0x2148
jmp 0x214a
leaq 0x20(%rsp), %rdi
addq $0x8, %rdi
xorl %eax, %eax
movl %eax, %esi
leaq -0x84e(%rip), %rdx      # 0x1910
movq %rsp, %rcx
callq 0x1120
cmpl $0x0, %eax
je 0x2245
movq 0x2e82(%rip), %rax      # 0x4ff8
movq (%rax), %rdi
leaq 0xeb8(%rip), %rsi       # 0x3038
movb $0x0, %al
callq 0x10e0
movq 0x2e6a(%rip), %rax      # 0x4ff8
movq (%rax), %rdi
leaq 0xea6(%rip), %rsi       # 0x303e
movb $0x0, %al
callq 0x10e0
movq 0x2e52(%rip), %rax      # 0x4ff8
movq (%rax), %rdi
leaq 0x1091(%rip), %rsi      # 0x3241
movb $0x0, %al
callq 0x10e0
movq 0x2e3a(%rip), %rax      # 0x4ff8
movq (%rax), %rdi
leaq 0xe9d(%rip), %rsi       # 0x3065
movb $0x0, %al
callq 0x10e0
movq 0x2e22(%rip), %rax      # 0x4ff8
movq (%rax), %rdi
leaq 0xe88(%rip), %rsi       # 0x3068
leaq 0xf64(%rip), %rdx       # 0x314b
movb $0x0, %al
callq 0x10e0
movq 0x2e03(%rip), %rax      # 0x4ff8
movq (%rax), %rdi
leaq 0xe85(%rip), %rsi       # 0x3084
movl $0x56, %edx
movb $0x0, %al
callq 0x10e0
movq 0x2de6(%rip), %rax      # 0x4ff8
movq (%rax), %rdi
leaq 0xe4a(%rip), %rsi       # 0x3066
movb $0x0, %al
callq 0x10e0
movq 0x2dce(%rip), %rax      # 0x4ff8
movq (%rax), %rdi
leaq 0xe5d(%rip), %rsi       # 0x3091
movb $0x0, %al
callq 0x10e0
movl $0x1, %edi
callq 0x1170
jmp 0x2247
jmp 0x2249
movq 0x20(%rsp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x1180
cmpl $0x0, %eax
je 0x2336
movq 0x2d91(%rip), %rax      # 0x4ff8
movq (%rax), %rdi
leaq 0xdc7(%rip), %rsi       # 0x3038
movb $0x0, %al
callq 0x10e0
movq 0x2d79(%rip), %rax      # 0x4ff8
movq (%rax), %rdi
leaq 0xdb5(%rip), %rsi       # 0x303e
movb $0x0, %al
callq 0x10e0
movq 0x2d61(%rip), %rax      # 0x4ff8
movq (%rax), %rdi
leaq 0xfc8(%rip), %rsi       # 0x3269
movb $0x0, %al
callq 0x10e0
movq 0x2d49(%rip), %rax      # 0x4ff8
movq (%rax), %rdi
leaq 0xdac(%rip), %rsi       # 0x3065
movb $0x0, %al
callq 0x10e0
movq 0x2d31(%rip), %rax      # 0x4ff8
movq (%rax), %rdi
leaq 0xd97(%rip), %rsi       # 0x3068
leaq 0xe73(%rip), %rdx       # 0x314b
movb $0x0, %al
callq 0x10e0
movq 0x2d12(%rip), %rax      # 0x4ff8
movq (%rax), %rdi
leaq 0xd94(%rip), %rsi       # 0x3084
movl $0x59, %edx
movb $0x0, %al
callq 0x10e0
movq 0x2cf5(%rip), %rax      # 0x4ff8
movq (%rax), %rdi
leaq 0xd59(%rip), %rsi       # 0x3066
movb $0x0, %al
callq 0x10e0
movq 0x2cdd(%rip), %rax      # 0x4ff8
movq (%rax), %rdi
leaq 0xd6c(%rip), %rsi       # 0x3091
movb $0x0, %al
callq 0x10e0
movl $0x1, %edi
callq 0x1170
jmp 0x2338
jmp 0x233a
movq 0x28(%rsp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x1180
cmpl $0x0, %eax
je 0x2427
movq 0x2ca0(%rip), %rax      # 0x4ff8
movq (%rax), %rdi
leaq 0xcd6(%rip), %rsi       # 0x3038
movb $0x0, %al
callq 0x10e0
movq 0x2c88(%rip), %rax      # 0x4ff8
movq (%rax), %rdi
leaq 0xcc4(%rip), %rsi       # 0x303e
movb $0x0, %al
callq 0x10e0
movq 0x2c70(%rip), %rax      # 0x4ff8
movq (%rax), %rdi
leaq 0xf02(%rip), %rsi       # 0x3294
movb $0x0, %al
callq 0x10e0
movq 0x2c58(%rip), %rax      # 0x4ff8
movq (%rax), %rdi
leaq 0xcbb(%rip), %rsi       # 0x3065
movb $0x0, %al
callq 0x10e0
movq 0x2c40(%rip), %rax      # 0x4ff8
movq (%rax), %rdi
leaq 0xca6(%rip), %rsi       # 0x3068
leaq 0xd82(%rip), %rdx       # 0x314b
movb $0x0, %al
callq 0x10e0
movq 0x2c21(%rip), %rax      # 0x4ff8
movq (%rax), %rdi
leaq 0xca3(%rip), %rsi       # 0x3084
movl $0x5c, %edx
movb $0x0, %al
callq 0x10e0
movq 0x2c04(%rip), %rax      # 0x4ff8
movq (%rax), %rdi
leaq 0xc68(%rip), %rsi       # 0x3066
movb $0x0, %al
callq 0x10e0
movq 0x2bec(%rip), %rax      # 0x4ff8
movq (%rax), %rdi
leaq 0xc7b(%rip), %rsi       # 0x3091
movb $0x0, %al
callq 0x10e0
movl $0x1, %edi
callq 0x1170
jmp 0x2429
xorl %eax, %eax
addq $0x2048, %rsp           # imm = 0x2048
retq